Control the Message encoding when sending email using EWS API
<p>I'm using Microsoft EWS (Exchange web services) to send emails to external customers (regarding support calls).</p>

<p>One of our customers is trying to automatically import the email message body to their own support call system (which is JAVA based i think) and they keep getting this exception:</p>

<p><strong>Unsupported Encoding Exception: iso-8859-10</strong></p>

<p>so they've asked me to change it to UTF8</p>

<p>If I send them an email from my Outlook (which is a client of the same Exchange) it works fine. It only happens when send via EWS.</p>

<p>Here's my code:</p>

<pre><code> protected void SendEmail2(string recipientsAddresses, string senderAddress, string ccRecipients, string subject, string body, bool CCToSender, bool simulate, Importance messageImportance)
    {
        ExchangeService service = null;
        EmailMessage message = null;

        try
        {
            // initialize a proxy to the exchange web services 
            service = new ExchangeService(MAGMA_EXCHAGE_VERSION);
            service.Url = new Uri(MAGMA_EWS_URI);

            // create the message
            message = new EmailMessage(service);

            // Add recipients
            foreach (string recipientEmail in recipientsAddresses.Split(";".ToCharArray()))
            {
                message.ToRecipients.Add(new EmailAddress(recipientEmail));
            }

            // handle inline images
            body = AddInlineImages(message, body);

            // set everything
            message.From = new EmailAddress(senderAddress);
            message.Subject = subject;
            message.Body = new MessageBody(BodyType.HTML, body);
            message.Importance = messageImportance;

            // and send
            message.Save();
            FolderId SentFolderForUser = new FolderId(WellKnownFolderName.SentItems, senderAddress);
            message.SendAndSaveCopy(SentFolderForUser);
        }
        catch (Exception)
        {
            throw;
        }
    }
</code></pre>

<p>The string that I pass to the "body" is an HTML that contains a:</p>

<p><strong>meta charset="utf-8"</strong> tag under the header.</p>

<p>Is there anything that I'm missing here?</p>

<p>Thanks, Gil.</p>