PDA

View Full Version : SmtpMail not working


marlatimcom
01-30-2005, 03:38 AM
Hi all,

I have the following email code and it is not sending an email. Any of you see what I am missing? Thanks in advance.




MailMessage mailmessage = new MailMessage();


string body = "this is the body";


body = body.Replace("\n", "\r\n");


mailmessage.To = "thisperson@comcast.net";


mailmessage.From = "this website";


mailmessage.Subject = "Register Request";


mailmessage.BodyFormat = MailFormat.Text;


mailmessage.Body = body ;





SmtpMail.SmtpServer = "localhost";


SmtpMail.Send(mailmessage);

Scott
01-31-2005, 01:13 AM
Is it possible that you are trying to test this on your local machine rather than the DASP server?

marlatimcom
01-31-2005, 02:51 AM
Thanks for the responses. The problem was with my email host, Comcast, and the junk filters that they have on their servers. I didn't have a legitimate from address in the email I was generating from the webform so that when the email hit Comcast theybounced it back.Once I put in a legitimate email address for the from address it all works fine.

bruce
01-31-2005, 12:06 PM
Looks fine to me!!

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)