I wrote a sending email in asp.net and I get this error. I don't Know how to solve it
The error :
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
The code :MailMessage msg = new MailMessage();
msg.From = new MailAddress(TextBox1.Text, "RUW Sport Center");
msg.To.Add(new MailAddress (TextBox3.Text));
msg.Subject = (TextBox4.Text);
msg.Body = TextBox5.Text;
msg.IsBodyHtml = true;
SmtpClient sc = new SmtpClient();
sc.Host = "smtp.gmail.com";
sc.Port = 25;
sc.Credentials = new NetworkCredential(TextBox1.Text, TextBox2.Text);
sc.EnableSsl = true;
sc.Send(msg);
Msgbx("Mail Send");

Dipankar BiswasRank #992 · 2K reputationPosted May 10, 2015, 8:03 PM EDT
check it..http://www.smarterasp.net/support/kb/a1546/send-email-from-gmail-with-smtp-authentication-but-got-5_5_1-authentication-required-error.aspx
Anubhav ChaudharyRank #29 · 42K reputationPosted May 10, 2015, 8:45 PM EDT
http://www.c-sharpcorner.com/UploadFile/cd7c2e/send-bulk-mails-using-smtp-configuration-part-2/
Manoj BhoirRank #599 · 4K reputationPosted May 10, 2015, 9:00 PM EDT
When you try to send mail from code and you find the error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required", than the error might occur due to following cases.
Case 1: when the password is wrong
Case 2: when you try to login from some App
Case 3: when you try to login from the domain other than your time zone/domain/computer
(This is the case in most of scenarios when sending mail from code)
Please check this link :
Gmail Error :The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required
http://stackoverflow.com/questions/20906077/gmail-error-the-smtp-server-requires-a-secure-connection-or-the-client-was-not
Aditya MishraRank #3,676 · 400 reputationPosted May 10, 2015, 9:02 PM EDT
this error occured due to security setting in gmail. go to security settings at the followig linkhttps://www.google.com/settings/security/lesssecureapps and enable less secure apps . So that you will be able to login from all apps.
Munesh SharmaRank #174 · 13.9K reputationPosted May 10, 2015, 9:05 PM EDT