TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Raja
NA
2k
358.7k
How to sent mail using smtp config.?
Apr 26 2017 11:38 AM
I use below code to mail config .thats works in other applications but my application shows the below error how to fix it.
Msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = ConfigurationManager.AppSettings["MailServer"];
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
Msg.From = new MailAddress(ConfigurationManager.AppSettings["MailFrom"]);
NetworkCred.Password = ConfigurationManager.AppSettings["MailPassword"];
smtp.Credentials = NetworkCred;
smtp.Port = 25;
smtp.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = delegate(object s, System.Security.Cryptography.X509Certificates.X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};
smtp.Send(Msg);
Error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Reply
Answers (
6
)
Access reports from reporting server to asp.net
How can I do parent/child in the bootstrap multiselect ?