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
Sujit Sahoo
NA
206
150.7k
GMAIL SMTP Error
Dec 3 2013 2:43 AM
Hi I am using this code to send mail from my ASP.net application but its showing error as I paste it below
Code to send Mail :
MailMessage mail = new MailMessage();
mail.To.Add(RecipientEmail);
mail.From = new MailAddress(ConfigurationManager.AppSettings["UserName"].ToString());
mail.Subject = subject;
mail.Body = MailBody;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = ConfigurationManager.AppSettings["Host"].ToString(); //Or Your SMTP Server Address
smtp.Port = Convert.ToInt32(ConfigurationManager.AppSettings["Port"]);
smtp.Credentials = new System.Net.NetworkCredential
(ConfigurationManager.AppSettings["UserName"].ToString(), ConfigurationManager.AppSettings["Pwd"].ToString());
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
Error :
{System.Net.Mail.SmtpException: 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 at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Application.LoginForm.sendMail(String subject, String MailBody, String RecipientEmail) in C:\ApplicationSource\src\Application\LoginForm.aspx.cs:line 293}
Reply
Answers (
4
)
what is the solution of all browsers working properly
Search a gridview on another page thats is already populated