Last post Feb 23, 2012 09:01 AM by dinakaran
Feb 23, 2012 06:27 AM|gurram ramu|LINK
Could not send mails to external domains like yahoo,gmail from windows 2003 mail server
I am trying to programmatically send an email to end users based on certain bahaviours (such as forgotton password, etc). But, I am getting the error:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for (email address).
I have done some reading about this and it seems that most people are able to fix this error by doing the following:
1) Right click on Default SMTP Virtual Server and select properties
2) Select the access tab
3) Click the Relay button
4) Click the Add button
5) Type in your ip address
I have tried this but am still getting the same error. .
does anybody have any idea what else i might be doing wrong??
Thanks in Advance.
Feb 23, 2012 07:59 AM|cnranasinghe|LINK
Check your from email is valid (valid domain).
Feb 23, 2012 08:35 AM|gurram ramu|LINK
Thanks for responce..
In mail server i have created one domain and also i created some mail accounts inside that domain .in MS-Outlook all mails are sending properly but programatically it displays above error..!.In smtp virtual server i created remote domain also.
Feb 23, 2012 08:43 AM|vinay13mar|LINK
hi check the link
Feb 23, 2012 09:00 AM|cnranasinghe|LINK
U have to make sure that your coding & email configurations are correct. if so your IP might be blocked as spamming.
if IP blocked u have wait serveral hours/days...to unblock.
Feb 23, 2012 09:01 AM|dinakaran|LINK
Try this functions
// Create a new blank MailMessage
MailMessage email = new MailMessage();
email.BodyFormat = MailFormat.Html;
email.From = "email@example.com";
email.To = "firstname.lastname@example.org";
email.Subject = "test";
email.Body = "bodycontents";
// Set the SMTP server and send the email
SmtpMail.SmtpServer = "localhost";
lblMessage.Text = "Your email has been sent";
lblMessage.Text = ex.ToString();