Celeb Glow
news | March 01, 2026

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required

I'm attempting to send email using G Suite's SMTP relay service. Using C#, my code snippet looks like this:

string message = "<em>It's great to use HTML in mail!!</em>"
var client = new SmtpClient("smtp.gmail.com", 587);
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(_senderEmailAddress, _senderPassword);
client.EnableSsl = true;
client.Send(message);

However, this results in the following exception:

System.Net.Mail.SmtpException HResult=0x80131500 Message=The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at

I searched around and there are variety of security settings required by G Suite.

  1. A strong password. I create a new strong password. Confirmed.
  2. 2-factor auth is off. Confirmed.
  3. Access to less secure apps is enabled. Here is screenshot of my settings, the first is the admin console enabling it for users, the second is the user enabling it:

enter image description here

enter image description here

  1. SMTP relay service is setup and configured. Here is screenshot of my settings: (as you can see, I have the least secure settings)

enter image description here

Any help anyone?

1 Answer

The above code and settings are CORRECT. The issue was that my password was not strong. I had been using a password tool to generate a password, which it declared as STRONG. However, G Suite did not. And shame on G Suite: it does not let you know.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy