Home All Groups Group Topic Archive Search About

AlternateView for Multipart Text/HTML Email Message

Author
6 Apr 2006 9:11 PM
Dan Walowski
Hello,

I have a program that is automatically generating email that consists of
HTML with a text backup.  This works just fine for all email clients except
Yahoo's online interface which displays these messages with the paperclip
indicating an attachment, but, there isn't an attachment.  Text by itself is
fine and HTML by itself is fine as well.  I think it has something with the
way .Net organizes the body parts.  Rather than just adding a body part, it
adds a wrapper body part around the Text and HTML body parts and I can't
find a way to change this behavior.  Any suggestions out there other than
ditching .Net for this application?

msgMail.AlternateViews.Add(System.Net.Mail.AlternateView.CreateAlternateViewFromString(strTextBody,
System.Text.Encoding.ASCII, "text/plain"))
msgMail.AlternateViews.Add(System.Net.Mail.AlternateView.CreateAlternateViewFromString(strHTMLBody,
System.Text.Encoding.ASCII, "text/html"))

Thanks,

Dan Walowski

AddThis Social Bookmark Button