can't send mail in html format

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Send Email 3
how to send custom e-mail with asp.net 1
Send email via external SMTP Server 4
Send mail error 1
threading and session object 8
Weird CDO Error 2
sending emails thro SMTP server 2
Can't SendMail 3

Top