The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated

When I tried to send automated emails using C#, I got the following error:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated

Cause :

  • The account used to sent email is not authenticated on exchange.
  • Send – Receive connectors are not configured properly.

Solution :

  • Check with your Exchange administrator to permit the e-mail account to send e-mail
  • Review the default receive connector and select anonymous users on the permissions groups tab.

If the previous points has been checked and still the issue exists so you should check your code by doing the following :

smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new System.Net.NetworkCredential(From, Password);

Also try to enable SSl before smtpClient.Send()

smtpClient.EnableSsl = true;

If you didn’t specify the user/pwd of the SmtpClient , use

smtpClient.UseDefaultCredentials = true;

Note :  SmtpClient is using the app pool identity account to connect to SmtpHost.

  • If the app pool identity is a domain account
    • You should give it the appropriate permission right to send E-mail.
  • If the app pool identity is not a domain account,
    • Try to change the app pool identity to a domain account which has right to send E-Mail.

 

Enjoy 🙂

Advertisements

2 thoughts on “The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated

  1. This design is incredible! You obviously know how to keep a
    reader entertained. Between your wit and your videos, I was almost moved to start myy oown blog
    (well, almost…HaHa!) Fantastic job. I rally enjoyed what
    you had to say, and moore than that, hoow you presented it.
    Too cool!

    Like

  2. This is the perfect website for anyone who would like to
    find out about this topic. You know so much its almost tough to argue
    with you (not that I personally will need to…HaHa). You certainly put
    a new spin on a subject which has been written about for years.
    Wonderful stuff, just great!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s