?
Solved

Sending Multipart email with WebDAV to external addresses

Posted on 2010-01-12
2
Medium Priority
?
756 Views
Last Modified: 2013-12-06
I've manage to send a multi-part(html and plaintext) email with attachments through webdav in exchange 2003 and as long as its sent to a user on the exchange server.

My problem is when the email is sent to an external email.  exchange drops the html section. and only sends the text/plain section.

steps to send.

1) http put to create the mail message in drafts

 format

 var strBody = string.Format( "From: {0}\n" + "To: {1}\n" + "Subject: {2}\n" + "Date: {3}\n" + "X-Mailer: {4}\n" + "MIME-Version: 1.0\n", message.From, message.To, message.Subject, DateTime.Now, "Thomson.MIS.Notification.WebDavTeleSalesGateway");
 
        const string boundary = "====_NextPart_0====";

            strBody += string.Format(
               "Content-Type: multipart/alternative; Boundary=\"{0}\"\n\n" +
               "--{0}\n" +
               "Content-Type: text/plain;\n" +
               "Charset=\"iso-8859-1\"\n" +
               "Content-Transfer-Encoding: 8bit\n\n{1}\n\n" +
               "--{0}\n" +
               "Content-Type: text/html;\n" +
               "Charset=\"iso-8859-1\"\n" +
               "Content-Transfer-Encoding: 8bit\n\n{2}\n" +
               "--{0}"
               , boundary, plainTextBody, htmlBody);

2) http PROPPATCH to set message up to receive attachments
3) http posts to add attachments to message
4) http MOVE to move the email to ##DavMailSubmissionURI## send the email

I've checked that the string in the put request to create the email in the drafts folder is correct, but the mail sent to the external mailbox has been changed and the html section dropped.

I noticed the boundary id has also been changed, but i assume this was changed when the attachments were posted to the message before it was sent.
0
Comment
Question by:simonwilberthurley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Satya Pathak earned 1000 total points
ID: 26388019
0
 

Author Closing Comment

by:simonwilberthurley
ID: 31675986
supplied the right link to explain the fundamentals to the answer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question