468,321 Members | 1,824 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

can't send mail in html format

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 = oa*****@univ.haifa.ac.il;
msgMail.From = we*******@aspheute.com;
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
Nov 17 '05 #1
3 1323
Hi

Check this URL, it may help you.
http://www.asprepository.com/Article...3Send_Email_us
ing_ASP.NET_formatted_in_HTML.htm

Ravikanth[MVP]

-----Original Message-----
Hi,

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

MailMessage msgMail = new MailMessage();
msgMail.BodyFormat = MailFormat.Html;
msgMail.To = oa*****@univ.haifa.ac.il;
msgMail.From = we*******@aspheute.com;
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
.

Nov 17 '05 #2
Hi

Check this URL, it may help you.
http://www.asprepository.com/Article...3Send_Email_us
ing_ASP.NET_formatted_in_HTML.htm

Ravikanth[MVP]

-----Original Message-----
Hi,

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

MailMessage msgMail = new MailMessage();
msgMail.BodyFormat = MailFormat.Html;
msgMail.To = oa*****@univ.haifa.ac.il;
msgMail.From = we*******@aspheute.com;
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
.

Nov 17 '05 #3
Try this

string strBody = "<b>Hello World</b>" +
" <font color=\"red\">ASP.NET</font>"; or just

string strBody ="<h1>Does this work now</h1>";

????

"Ofir Amitai" <aa*****@univ.haifa.ac.il> wrote in message
news:uL**************@tk2msftngp13.phx.gbl... 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 = oa*****@univ.haifa.ac.il;
msgMail.From = we*******@aspheute.com;
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

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ofir Amitai | last post: by
5 posts views Thread by Yossi Naggar | last post: by
6 posts views Thread by scottyman | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.