While working with AWS SES, I think I have two choices to send mail. Java is the programming language I use:
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