Sivajihero Hero

Sivajihero Hero

  • NA
  • 105
  • 32.7k

Problem in sending mail in my asp.net application.

Feb 17 2016 5:43 AM

In my asp.net application while sending the mail, I am getting this error message.

Mailbox unavailable. The server response was: bosauthsmtp15: Host 82.147.210.134:
No unauthenticated relaying permitted

This is my code for sending the mail.


using (MailMessage mm = new MailMessage("sendingemailaddress","toaddress"))

{
mm.Subject = " Report PDF example";
mm.Body = " Report PDF example";
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.server.com";//here server denotes company server address.
NetworkCredential credential = new NetworkCredential();
credential.UserName = "sendingemailaddress";
credential.Password = "password";
smtp.UseDefaultCredentials = true;
smtp.Credentials = credential;
smtp.Port = 587;
smtp.EnableSsl = false;
smtp.Send(mm);
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
"alertMessage",
"alert('message send successfully');", true);
}


Answers (20)