I got this following error “The SMTP server requires a secure connection or the client was not authenticated. The server response was:5.5.1 authentication Required” while attempting to send mail using asp.net c# (i.e Google authentication required).
Solution to gmail server error:
Case 1:Please enter the correct password!. Otherwise,It may happen SMTP server error, due to the invalid password.
Case 2: Google may block the sign in attempt due modern security standards. You need to enable the following features. Login into your google account and go to:
If you want to use, turn on the less secure access.
c# send mail coding,
using (MailMessage mail = new MailMessage())
mail.From = new MailAddress("EMAILID@gmail.com"); //secureserver email settings
mail.To.Add("firstname.lastname@example.org"); //sender emailID
mail.Subject = "Greetings";
mail.Body = "<h1>Welcome User</h1>";
mail.IsBodyHtml = true;
using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587))
smtp.Credentials = new System.Net.NetworkCredential("EMAILID@gmail.com", "password"); //secureserver settings
smtp.EnableSsl = true;
Post your comments / questions
- How to check PAN-Aadhaar is Linked or NOT?
- How to customize pagination for django admin?
- How to fix HAXM is not installed |in Android Studio
- How to fix CMOS Checksum Error in Computer or Laptop | SOLVED
- Reactivating windows after a Hardware change on PC or Laptop
- FIXED: Windows reported that the hardware of your device has changed. Error code :0xc004F211
- "redirect" is not defined pylance("reportUndefinedVariable)
- This action cannot be completed because the file is open in SQL Server(SQLEXPRESS) - FIXED