Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4000878
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:50:10+00:00 2026-05-20T07:50:10+00:00

This issue came to light as I was trying to send an HTML message

  • 0

This issue came to light as I was trying to send an HTML message with inline images (attachments) through EWS. However I have backed off to the simplest form and found that I cannot even send HTML messages.

I am using C#, .NET 4, EWS API 1.1, Exchange Server 2010 SP1.

Here is the core of my code:

ExchangeConnection = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
ExchangeConnection.Credentials = new WebCredentials(Username, Password, Domain);
ExchangeConnection.Url = new Uri(ServiceURI);

string MailBody = @"<html><head></head><body>
    This is a <b>test</b> <strong>HTML</strong> <em>message</em>.<br><br>
    Did it work?</body></html>";

NewMessage = new EmailMessage(ExchangeConnection);
NewMessage.Subject = "Test HTML Message #001";
NewMessage.Body = MailBody;
NewMessage.Body.BodyType = BodyType.HTML;
NewMessage.ToRecipients.Add("tony@zierniemann.com");
NewMessage.Send();

Using that code I receive a message with the following content:

Subject: Test HTML Message #001
Thread-Topic: Test HTML Message #001
Thread-Index: Acuy3U6nqQTa4W4ZQu6ueHPb2nPDPg==
Date: Thu, 13 Jan 2011 04:49:48 +0000
Message-ID: <2FDB41070D0AC24DB5BC8B80751063630B74A5@xxxxx.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [x.x.x.x]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)]
X-MAIL-FROM: <planit@xxxxx.com>
X-SOURCE-IP: [67.136.148.58]
X-AnalysisOut: [v=1.0 c=1 a=WYc53Y7r_f4A:10 a=BLceEmwcHowA:10 a=kj9zAlcOel]
X-AnalysisOut: [0A:10 a=xqWC_Br6kY4A:10 a=ERe/uVw5acJt2lgRGY+7Og==:17 a=10]
X-AnalysisOut: [TGqZ3wK2PL4t1FdnoA:9 a=mfhh-WWaJa5gWHOyyF854Vzt7EAA:4 a=Cj]
X-AnalysisOut: [uIK1q_8ugA:10]

This is a test HTML message.

Did it work?  

There is no MIME declaration and there is no text/html section.

If I send a similar message through Outlook (on the same Exchange server) I get something like this:

Subject: Test From Outlook
Thread-Topic: Test From Outlook
Thread-Index: AcuzMwJCFB8PS6wYQeeV4IeSkT/mxQ==
Date: Thu, 13 Jan 2011 15:03:17 +0000
Message-ID: <E026BAD23A27DB42B74F0DB569E9986977F237@CHALLENGER.DenverZoo.lan>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [x.x.x.x]
Content-Type: multipart/alternative;
    boundary="_000_E026BAD23A27DB42B74F0DB569E9986977F237CHALLENGERDenverZ_"
MIME-Version: 1.0
X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)]
X-MAIL-FROM: <tonyn@xxxx.com>
X-SOURCE-IP: [67.136.148.58]
X-AnalysisOut: [v=1.0 c=1 a=olvCdMnC_oMA:10 a=BLceEmwcHowA:10 a=xqWC_Br6kY]
X-AnalysisOut: [4A:10 a=ERe/uVw5acJt2lgRGY+7Og==:17 a=2iPVs5MlqxP_VJ4oz58A]
X-AnalysisOut: [:9 a=x0_hJeNGqEWpZ67nkUaF-VHO8CMA:4 a=CjuIK1q_8ugA:10 a=yM]
X-AnalysisOut: [hMjlubAAAA:8 a=SSmOFEACAAAA:8 a=bSa8Y9cTgW9e4uXm0lgA:9 a=w]
X-AnalysisOut: [EVqP49dmlVP1afgSrUA:7 a=MTMROL1LpFqQeTH2_C9armvf4mgA:4]

--_000_E026BAD23A27DB42B74F0DB569E9986977F237CHALLENGERDenverZ_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

This is an HTML message.

What do the headers look like?

Tony

--_000_E026BAD23A27DB42B74F0DB569E9986977F237CHALLENGERDenverZ_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
... the correct html code for the message follows here ...

Can anyone explain to me how to get a message like the second one through the code using EWS? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:50:10+00:00Added an answer on May 20, 2026 at 7:50 am

    I just had a very similar problem. We finally nailed it down to one particular account that was receiving a mangled version of the email instead of the proper multi-part MIME text and HTML. It turns out the problem was this account was setup in Exchange to have “Use Default Settings” for MAPI Rich Text emails (in the General tab), when other accounts were set to “Never”.

    So the problem was basically that Exchange knew about the contact email being sent to and tried to be “smart” and send it in proprietary format for Outlook, but the client for that address wasn’t using Outlook and so they weren’t able to view the email correctly. I think it’s also possible to change this setting at a global level instead of by user, but I’m not sure where that is.

    The reason it works when sent through Outlook is that Outlook 2010 is able to send the email in a way that forces the message to be in HTML format, whereas EWS managed API doesn’t seem to be able to do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This issue came up when I got different records counts for what I thought
While researching the issue of JSON vs XML , I came across this question
This issue is driving me mad. I have several tables defined, and CRUD stored
Has anyone come across this issue? Seems MS have broken it with their own
I do not currently have this issue , but you never know, and thought
I've run into this issue quite a few times and never liked the solution
I am running into this issue of releasing an already released object but can't
Ok this is a general question about how to solve this issue, not to
A quick Google search of this issue shows it's common, I just can't for
A discussion about Singletons in PHP has me thinking about this issue more and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.