简体   繁体   中英

AWS SES - SMTP vs SES client

While working with AWS SES, I think I have two choices to send mail. Java is the programming language I use:

  1. Use Amazon SES client library
  2. Send mail using SMTP (maybe using Java mail API).

But I guess Amazon SES client library is not using SMTP - I guess it is using HTTPS for the communication from my machine to the mail server.

Or is it another layer built on top Java SMTP library for easier configuration?

I am asking this because I could not configure SMTP port etc when I am using Option #1 above.

Can you please help me understand the difference? Thanks in advance.

You are correct, you have both options to send email.

Option 1 uses SES API, which is available via HTTPS. So it is not related to SMTP protocol.
You have the same capabilities, but instead of use SMTP protocol you will be using SES API.

As it is an AWS API you will need to provide credential to use it.

Java example:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-sdk-java.html


The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer Security (TLS).

Regarding option 2, it is mandatory to use TLS, so each type of TLS option has its own available ports.

Ports for STARTTLS: 25, 587, or 2587
Ports for SMTPS: 465 or 2465

It is also mandatory to use authentication.

So you SMTP client must support TLS (STARTTLS or SMTPS) and authentication.

Documentation:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html

Java example using STARTTLS:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-java.html

If you run in a private network w/o Internet GW you need SMTP as there is no VPC interface endpoint for SES. There is a feature request open w/ AWS but no ETA

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM