How do I use SMTP to send emails through Amazon SES?

3 minute read
1

I want to set up Simple Mail Transfer Protocol (SMTP) to use Amazon Simple Email Service (Amazon SES) to send emails.

Resolution

To set up SMTP with Amazon SES and connect to the SES SMTP endpoint to send emails from, complete the following steps:

  1. Open the Amazon SES console.

  2. From the navigation pane, choose SMTP Settings.

  3. Under Simple Mail Transfer Protocol (SMTP) settings, note the values for SMTP endpoints and ports. Use the SMTP endpoint and ports to connect to SMTP. For example, if you're in the eu-west-1 AWS Region, then note the following endpoint and ports:
    SMTP endpoint: email-smtp.eu-west-1.amazonaws.com
    Port: 25, 465, or 587

  4. Choose Create SMTP credentials. The AWS Identity and Access Management (IAM) console opens.
    Note: The SMTP credentials are different from the access keys that you create with IAM for an SMTP user.

  5. Follow the steps to generate your SMTP credentials.
    Note: To send emails to more than one AWS Region, you must generate a set of SMTP credentials for each AWS Region.

  6. Select the SES SMTP port that you send emails from based on the connection method that you want to use (STARTTLS or TLS Wrapper).
    Important: Amazon Elastic Compute Cloud (Amazon EC2) restricts outbound traffic on port 25 for all Amazon EC2 instances by default. If you have to use SMTP port 25, then you can request to remove this restriction. Or, you can select a different port to send emails from.

  7. Connect to the SES SMTP endpoint to test the connection over the port that you want to send emails from. For example, run the following telnet command:

    $ telnet email-smtp.eu-west-1.amazonaws.com 465

    Example output:

    Connected to email-smtp.eu-west-1.amazonaws.com.
  8. After you confirm that the connection to the port is successful, use the command line to send email through the Amazon SES SMTP interface.

If you experience any connection or timeout issues, then see How do I troubleshoot SMTP connectivity or timeout issues with Amazon SES?

Related information

Why do I get a "535 Authentication credentials invalid" error from an Amazon SES SMTP endpoint?

Why do I get an "Invalid MAIL FROM" or "Invalid RCPT TO" error response from an Amazon SES SMTP endpoint?

How do I resolve the error "SMTP server requires a secure connection or the client is not authenticated. The server response was: Authentication required" while sending an email through SES?