Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465, response: -1
With amazon SES, configuration needs to be as follows:
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.ssl.enable">true</prop>
instead of:
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
as hinted by dave.
EDIT: Please use this solution: https://stackoverflow.com/a/8928559/536299
Amazon SES SMTP requires the SSL before the SMTP session. The StartTLS command is not supported by SES.
These settings worked for me:
mail.transport.protocol=smtp mail.smtp.port=25 mail.smtp.auth=true mail.smtp.starttls.enable=true mail.smtp.starttls.required=true mail.smtp.host=email-smtp.us-east-1.amazonaws.com mail.smtp.user=[SMTP username] mail.smtp.password=[SMTP user password]
If you try to connect to connect using SSL connection, it rejected the connection. So you need to do STARTTLS after connection.
You can add mail.debug=true to see where it failed.
The sender email address must be a verified email address otherwise SES refuses to forward the email.