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 KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 11:28 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 9:17 PM EST
Qualification: " + txtqualification.Text + "
Enquiry about: " + txtenquiry.Text,
Sivajihero Hero99 reputationPosted Feb 17, 2016, 1:22 AM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 1:22 AM EST
Sivajihero Hero99 reputationPosted Feb 17, 2016, 1:23 AM EST
Michael GriffithsRank #1,251 · 1.4K reputationPosted Feb 17, 2016, 1:28 AM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 1:30 AM EST
Monica Bundel100 reputationPosted Feb 17, 2016, 1:32 AM EST
Add mail settings to Web.conf in the system.net section, use can set the default from address in smtp section.
from="[email protected]"> enableSsl="false" host="smtp.gmail.com" password="secretone" port="25" userName="[email protected]" />then in your C# code you have a option to vary it by passing a from parameter to MailMessage.
var smtp = new SmtpClient(); smtp.Send(new MailMessage("[email protected]", "[email protected]") { IsBodyHtml = true, Subject = "Some subject", Body = "add html code here" });Jithil JohnRank #2,791 · 506 reputationPosted Feb 17, 2016, 1:32 AM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Feb 17, 2016, 3:50 AM EST
Sivajihero Hero99 reputationPosted Feb 17, 2016, 7:36 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 7:38 PM EST
Sivajihero Hero99 reputationPosted Feb 17, 2016, 8:52 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 17, 2016, 8:56 PM EST
Sivajihero Hero99 reputationPosted Feb 17, 2016, 9:17 PM EST
Suresh MRank #171 · 14K reputationPosted Feb 17, 2016, 9:19 PM EST
Sivajihero Hero99 reputationPosted Feb 17, 2016, 10:51 PM EST
Sivajihero Hero99 reputationPosted Feb 21, 2016, 9:51 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Feb 21, 2016, 9:53 PM EST
Monica Bundel100 reputationPosted Feb 17, 2016, 1:12 AM EST