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);
}
Chandu KumawatPosted Feb 18, 2016, 4:28 AM
Chandu KumawatPosted Feb 22, 2016, 2:53 AM
Sivajihero HeroPosted Feb 22, 2016, 2:51 AM
Sivajihero HeroPosted Feb 18, 2016, 3:51 AM
Suresh MPosted Feb 18, 2016, 2:19 AM
Chandu KumawatPosted Feb 18, 2016, 2:17 AM
Qualification: " + txtqualification.Text + "
Enquiry about: " + txtenquiry.Text,
Sivajihero HeroPosted Feb 18, 2016, 2:17 AM
Chandu KumawatPosted Feb 18, 2016, 1:56 AM
Sivajihero HeroPosted Feb 18, 2016, 1:52 AM
Chandu KumawatPosted Feb 18, 2016, 12:38 AM
Sivajihero HeroPosted Feb 18, 2016, 12:36 AM
Rajeesh MenothPosted Feb 17, 2016, 8:50 AM
Jithil JohnPosted Feb 17, 2016, 6:32 AM
Monica BundelPosted Feb 17, 2016, 6:32 AM
Add mail settings to Web.conf in the system.net section, use can set the default from address in smtp section.
then in your C# code you have a option to vary it by passing a from parameter to MailMessage.
Chandu KumawatPosted Feb 17, 2016, 6:30 AM
Michael GriffithsPosted Feb 17, 2016, 6:28 AM
Sivajihero HeroPosted Feb 17, 2016, 6:23 AM
Chandu KumawatPosted Feb 17, 2016, 6:22 AM
Sivajihero HeroPosted Feb 17, 2016, 6:22 AM
Monica BundelPosted Feb 17, 2016, 6:12 AM