When I send email from my ASP.NET page on server, it gives the following error Message: (email works fine if I send from my dev pc) -------------------------------------------------------------------------- -------------------------------------------------------------------- I used the following simple code (in the code behind page), that I found in a kb article: (I purposely changed my domain info) -------------------------------------------------------------------- public partial class Email2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //create the mail message MailMessage mail = new MailMessage(); //set the addresses mail.From = new MailAddress("postmaster@mydomain"); mail.To.Add("postmaster@mydomain"); //set the content mail.Subject = "This is an email"; mail.Body = "This is from system.net.mail using C sharp with smtp authentication."; //send the message SmtpClient smtp = new SmtpClient("mail.mydomain"); NetworkCredential Credentials = new NetworkCredential("postmaster@mydomain", "secret"); smtp.Credentials = Credentials; //smtp.Port = 587; try { smtp.Send(mail); lblMessage.Text = "Mail Sent"; } catch (Exception exc) { lblMessage.Text = exc.ToString(); } } } ------------------------------------------------------------- I would appreciate any help. Thanks in advance.
The error message suggests that you are trying to send emails using the smtp server with the following IP address: 69.147.95.95. We do not host this server. Accouding to nslookup, the host name of this IP is redir1.biz.mail.vip.sp1.yahoo.com. We do not allow relaying messages to the servers we do not host. Please make sure DNS/MX of your domain are pointing to our servers and that you are using the smtp server provided to your Winhost account.