none
[E2016][EWSMA]Sending HTML email not working for outside recipients RRS feed

  • Question

  • I am trying to send an html formatted email using EWS Managed API 2.2. The email looks fine when I send it to my exchange email address and view it via Outlook. When I send it to a gmail or yahoo mail account, the received email is plain text only.

    Here is the code I am using to send the email:

    EmailMessage email = new EmailMessage(service);
    email.ToRecipients.Add("kgkayak@gmail.com");
    email.Subject = "Hello World";
    string msgBody = "<html><body>This is the <b>first</b> email I've sent by using the EWS Managed API</body></html>";
    email.Body = new MessageBody(BodyType.HTML, msgBody);
    email.Send();

    I've also tried this without the html tags and without html or body tags, all with the same result.

    Also worth noting is that, using the same exchange server, I can send HTML email using Outlook to compose the email, and it is received in gmail and yahoo email with the html formatting intact.

    Can anyone tell me what I am doing wrong?

    Note recent edit - I am using Exchange 2016 (not 2013).



    • Edited by KenMDT Tuesday, September 20, 2016 3:41 PM
    Tuesday, September 20, 2016 3:11 PM