Html body with .Net

Discussion regarding the Standard version.
Post Reply
Posts: 1
Joined: Fri Feb 28, 2014 12:16 am

Html body with .Net

Post by cesarqz86 » Fri Feb 28, 2014 12:21 am

Hi guys,

I need help, I'm trying to send an email with a HTML body, but always the mail arrived as a plain text, this is my code:

mailMessage.From = from;
mailMessage.Subject = subject;
AlternateView alternate = AlternateView.CreateAlternateViewFromString(message, new ContentType("text/html"));
mailMessage.IsBodyHtml = true;
mailMessage.Priority = MailPriority.High;

And this is my HTML message:

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">
<LINK rel=\"stylesheet\" type=\"text/css\" media=\"screen\" charset=\"utf-8\" href=\"{0}\">
<DIV align=\"center\">
<DIV class=\"DIVImageMail\">
<DIV align=\"center\" class=\"DIVContentText\">
<P class=\"contentText\">
<span class=\"contentName\">
Hi {1},
Best Regards<br />

Post Reply