SmtpMail not working

Discussion in 'ASP.NET / ASP.NET Core' started by marlatim, Jan 30, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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 = "[email protected]";


    mailmessage.From = "this website";


    mailmessage.Subject = "Register Request";


    mailmessage.BodyFormat = MailFormat.Text;


    mailmessage.Body = body ;





    SmtpMail.SmtpServer = "localhost";


    SmtpMail.Send(mailmessage);
     
  2. Is it possible that you are trying to test this on your local machine rather than the DASP server?
     
  3. 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.
     
  4. Bruce

    Bruce DiscountASP.NET Staff

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page