473,378 Members | 1,138 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1416
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gene Ellis | last post by:
Hey everyone, I have a simple task. I want to take an XML file, pull out the elements in it, format them, and then send an html email based on it. What are the necessary steps? Any suggestions?...
8
by: LRW | last post by:
I'm not sure this message is totally appropriate for this group, so please, if anyone has a better group suggestion, let me know! My company sends out a monthly newsletter in HTML format to our...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
0
by: Ofir Amitai | last post by:
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();...
5
by: Yossi Naggar | last post by:
Hello to everyone, Does anybody know how to send html formatted messages with asp.net? I tried to send such messages with the code below but the content type is wrong. The content type is...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: Michael31277 | last post by:
I keep getting this error on my form code, but only when I keep the MailNewObj.Send in the code, so I know it is this... I get the 500 INTERNAL ERROR message.. I tried shutting off "friendly...
2
by: urbanedge | last post by:
I've just acquired a site and uploaded to godaddy and the email function won't work. I'm new to php and I'm not able to determine where the issue is. I've commented out $this->header .=...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.