can't send mail in html format

  • Thread starter Thread starter Ofir Amitai
  • Start date Start date
O

Ofir Amitai

Hi,

I have this very annoying problem: I'm trying to send email in html format
through smtp but i always get it in text format.
here is the code:

MailMessage msgMail = new MailMessage();
msgMail.BodyFormat = MailFormat.Html;
msgMail.To = (e-mail address removed);
msgMail.From = (e-mail address removed);
msgMail.Subject = "Hi Chris, another mail";
string strBody = "<html><body><b>Hello World</b>" +
" <font color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;

SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(msgMail.From, msgMail.To, msgMail.Subject, msgMail.Body);

any ideas?

Regards,
Ofit Amitai
 
Back
Top