EWS Managed API - Set EmailMessage.From on new message RRS feed

  • Question

  • Hi,

    When creating an email on behalf of a user in the AD, who has multiple email addresses, it seems the "set-as-reply" address is used as the from address.

    Is it possible to choose between the users valid (according to AD) addresses?
    Also is it possible to set the friendly display name?
    Should EmailMessage.Sender be used instead of EmailMessage.From? (In my test it has not made any difference.)

    Following does not seem to be working as hoped:
    AD user: Brian Rasmussen-Rene. Email addresses: (Set-as-reply).

    ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
    exchangeService.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
    EmailMessage message = new EmailMessage(exchangeService);
    message.From = new EmailAddress();
    message.From.Name = "Developer";
    message.From.Address = "";
    message.Subject = "TEST";
    message.Body = "TEST";
    message.Body.BodyType = BodyType.Text;
    Will display as from Brian Rasmussen-Rene []
    Desired outcome is Developer []

    Kind regards,
    Brian Rasmussen-Rene

    Friday, January 7, 2011 11:46 AM

All replies