How to change a custom display name ?

Dim service As ExchangeService = Nothing
Dim msg As EmailMessage = Nothing
 service = New ExchangeService(ExchangeVersion.Exchange2007_SP1)
service.AutodiscoverUrl("one@xxx.edu")
service.Credentials = New WebCredentials(User, Password, Domain)

            msg = New EmailMessage(service)
            msg.ToRecipients.Add(New EmailAddress(pRecipient))
            msg.Subject = pSubject
            msg.Body = New MessageBody(BodyType.HTML, pBody)
            'msg.From = New EmailAddress("custom display name <one@xxx.edu>;")

'    msg.From.Name="custom display name"

  msg. From=new EmailAddress("one@xxx.edu", "Custom Display Name");

            msg.Send()

I tried the above three ways to change the display name, but either of them work. Any help, please, Thanks

                                          
March 25th, 2015 3:44pm

That won't work as EWS (and MAPI) will always resolve Sender back to the Primary Email address and displayname of the owner of the Mailbox your trying to send as when its submitted. You might want to try SMTP instead

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
March 25th, 2015 6:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics