Can't SendMail

T

Tom

Using Visual Web Developer 05 Express and this code:
using System.Web.Mail;

MailMessage mail = new MailMessage();
mail.BodyFormat = MailFormat.Html;

mail.To = txtEmailAddress.Text;

mail.From = "tgaughan@nuNO__SPAMmail.org";

mail.Subject = "Test";

string strBody = @"Test Body";

mail.Body = strBody;

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mail);

The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for tgaughan@nuNO__SPAMmail.org

Thanks in advance...
 
B

Brian Williams

You need to check your relay restrictions, probably add the IP.

Go to IIS and Right Click on SMTP Virtual Server then select Properties.

Click the Access tab.

Under "Relay Restrictions" add the IP Address of the server you are running
the code from.



Regards,

Brian K. Williams
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top