Sneha Joshi
Sneha Joshi

Reputation: 81

Email Code Error

In Email code, I get following error.

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

Is this indicating that we require SSL certificate ?

Upvotes: 1

Views: 87

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038810

This error code means that you need to provide a valid credentials in order to use this smtp server:

var client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.Credentials = new NetworkCredential("[email protected]", "secret");

Upvotes: 3

Related Questions