1

I try to send an email using the amazon SES service. My code is taken from their documantation:

 public static void SendWithSMTP(string username, string password, string host, int port)
{
    using (var client = new System.Net.Mail.SmtpClient(host, port))
    {
        client.Credentials = new System.Net.NetworkCredential(username, password);
        client.EnableSsl = true;
        client.Send("from@example.com", "to@example.com", "This is a test subject.", "This is a test email message body.");
    }

the problem is that i get the following exception:

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

Is there anyone who had the same or similar problem? Any suggestions on this problem?

gustantin
  • 11
  • 2
  • http://stackoverflow.com/questions/6477055/the-smtp-server-requires-a-secure-connection-or-the-client-was-not-authenticated\[Check this] – Usher Jun 24 '12 at 09:41

1 Answers1

1

this seems that the key you are using is wrong, please confirm this otherwise create a new one.

Ensure that the sender id is also permitted to send email the same can be done from Amazon ses control panel.

In your code you must permit from@example.com to send email

Anton Sizikov
  • 9,105
  • 1
  • 28
  • 39
susheel
  • 15
  • 1