Martini48 Martini48 - 20 days ago 5
ASP.NET (C#) Question

C# HTML E-Mail - Alternate View

I am having an issue testing alternate views while sending HTML E-Mails. I am creating sending the mail message as plain text, but I include an HTML alternate view. I have tried using several e-mail clients, but I have been unable to see the plain text version. My main concern is that someone who does use a plain text only client won't see it correctly. See below for code:

MailMessage message = new MailMessage();

message.To.Add("email");
message.From = new MailAddress("fromaddress");
message.Subject = "subject"
//Plain text version of e-mail
message.Body = _formattedPlainText;
message.IsBodyHtml = false;

AlternateView htmlView = CreateHTMLView();

message.AlternateViews.Add(htmlView);
//message.AlternateViews.Add(plainTextView);

smtp.Send(message);

private AlternateView CreateHTMLView()
{
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(_formattedHTML, null, System.Net.Mime.MediaTypeNames.Text.Html);

//Code for adding embedded images...

return htmlView;
}


Is there reason to believe the plain text version isn't being received or are there any clients you know that definitely can only receive plain text e-mails?

Thanks in advance

UPDATE:

You can force plain text in GMAIL by pressing the options arrow and selecting the option "Message Text Garbled?"

Answer

Is there reason to believe the plain text version isn't being received or are there any clients you know that definitely can only receive plain text e-mails?

No, and PINE.

You could use the mail command in any *nix OS to read email. It will only display email in text format.

UPDATE

A guy here, claims that GMAIL ONLY displays emails in plain text if given the option. I find that an awkward default choice from Google if that's still the case.