Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm currently developping a program that will serve to send emails via company's EWS. the code for sending the message works perfectly but i also need to get some data about the sender of the email. It means, when a user sends the email to me, I need to see his position and address. I'm struggling for more then a week to find a way to define the sender in the code and his contact details. And still nothing found so far.

Will appreacite your helf!

My code so far:

VB
Dim url As String = "https://.../ews/Exchange.asmx"
    exch.Url = New System.Uri(url)
    exch.UseDefaultCredentials = False
    exch.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox1.Text)
    ' exch.AutodiscoverUrl("myemail")
    'exch.ResolveName("", ResolveNameSearchLocation.ContactsThenDirectory, True)
    Dim message As New EmailMessage(exch)
    message.Subject = "Новое заявление - " & ComboBox1.SelectedItem
    message.Body = "Добрый день!" & vbNewLine & vbNewLine & "Прошу обработать заявление - " & ComboBox1.SelectedItem
    For Each f In attfiles
        message.Attachments.AddFileAttachment(f)
    Next
    message.ToRecipients.Add(email)
    message.SendAndSaveCopy()
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900