email error: 533 sorry, that domain isn't in my list of allowed rcpthosts

Discussion in 'ASP.NET / ASP.NET Core' started by tgolisch, Jun 12, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. When I try to send email, I get this error: "533 sorry, that domain isn't in my list of allowed rcpthosts".
    My code looks like several other examples on this site. It seems to work from my dev machine by not from my aspnet site.
     
  2. Okay. I think I figured it out. The docs for this server seemed to suggest that when I send, I should use the smtp server provided by discount asp net [mail.mydomain.com]. It turns out that I actually need to have the smtp server pointed to localhost.

    so instead of:
    MailMessage mail = new MailMessage();
    mail.To = txtTo.Text;
    mail.From = "[email protected]";
    mail.Subject = "email test";
    mail.BodyFormat = System.Web.Mail.MailFormat.Text;
    mail.Body = "This was a test to see if email is working";
    System.Web.Mail.SmtpMail.SmtpServer ="mail.mydomain.com";
    SmtpMail.Send(mail);

    it needed to say:

    MailMessage mail = new MailMessage();
    mail.To = txtTo.Text;
    mail.From = "[email protected]";
    mail.Subject = "email test";
    mail.BodyFormat = System.Web.Mail.MailFormat.Text;
    mail.Body = "This was a test to see if email is working";
    System.Web.Mail.SmtpMail.SmtpServer ="localhost";
    SmtpMail.Send(mail);
     
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