Gmail Error :The Smtp Server Requires a Secure Connection or the Client Was Not Authenticated. the Server Response Was: 5.5.1 Authentication Required

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

This generally happens when you try login from different time zone or IP Address Computer. Your production server and the mail id you have used both are in different time zone. Choose either of these two solutions:

1) Log in to production server via remote access, and sign in to gmail once with your credentials. They will ask for the confirmation, confirm it and log out.

Or 2) log in gmail to your local computer, Follow this Link and choose review this activity and take proper actions.

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

First check for gmail's security related issues. You may have enabled double authentication in gmail. Also check your gmail inbox if you are getting any security alerts. In such cases check other answer of @mjb as below

Below is the very general thing that i always check first for such issues

client.UseDefaultCredentials = true;

set it to false.

Note @Joe King's answer - you must set client.UseDefaultCredentials before you set client.Credentials

the SMTP server requires a secure connection or the client was not authenticated. The server response was 5.5.1, Authentication required

  1. Check your gmail account and turn on "Acess for less secure apps"

  2. Set client.UseDefaultCredentials = false; before client.Credentials = new NetworkCredential("Sender email", "Sender email password");

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

Your errors...

The SMTP server requires a secure connection or the client was not authenticated.

  1. Are you running on HTTPS?
  2. You didn't provide proper authentication. You do realize you need your real email address (the username attribute; you're using Gmail, so you have to provide your Gmail address) and your real password to send emails from your account, right? (That includes the from field.) Gmail also has some extra complications. See this post on how to send emails from Gmail.

Mailbox name not allowed. The server response was: Envelope FROM 'hi@gmail.com' email address not allowed.

You tried to send an email from "hi@gmail.com". Do you think it will work? Let's pretend your email is bob@gmail.com. If what you attempted didn't result in an error, that means that I can send an email from your email without your permission! So no, that rightly shouldn't work.

All else aside, please don't try to send emails from the client-side. You realize that if you publish your app everyone can see your email address
and password, right?



Related Topics



Leave a reply



Submit