- Newest
- Most votes
- Most comments
Your test (using telnet) is connecting to the SMTP port on the SES mail server; but your code is trying to call the SES endpoint (which is HTTPS and uses port 443) so those are two different things. The error message you're getting is telling you that too.
Also, your test is to email-smtp.eu-central-1.amazonaws.com
but the code is connecting to email.eu-central-1.amazonaws.com
.
Check to see that your instance is able to connect to email.eu-central-1.amazonaws.com
on port 443.
make sure you have allowed port 25, 465, 587 & 443 depending on what you are using to talk to SES. Also did you test the telnet from your application server?
you can check below links for more details.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-set-up-vpc-endpoints.html https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
I have the connection to
email-smtp.eu-central-1.amazonaws.com
however I do not have connection toemail.eu-central-1.amazonaws.com
on port 443 even though I opened a 443 port in mysmtp endpoint
. How to fix this?
I'm having the same problem, but in my case I can't stop using the AWS SDK because I depend on it for credentials, what can I do in this case?
Given the age of this question and that your question is a different topic I'd suggest creating a new post for that. But if you're using the AWS SDK then you can use the SES methods in it - that's what the SDK is there for.
Okay, I solved the problem. I stopped using aws ses sdk, because it tries to connect through HTTPS, while I need to connect through SMTP on 587 port. So here is my final configuration
spring:
mail:
host: email-smtp.eu-central-1.amazonaws.com
username: ${AWS_SES_USERNAME}
password: ${AWS_SES_PASSWORD}
port: 587
protocol: smtp
properties:
mail.smtp.auth: true
mail.smtp.starttls.enable: true
mail.smtp.starttls.required: true
mail.smtp.ssl.trust: email-smtp.eu-central-1.amazonaws.com
test-connection: false
To generate AWS_SES_USERNAME
and AWS_SES_PASSWORD
you need to sign in into aws console, go to Amazon SES
-> SMTP Settings
-> Create my SMTP credentials
Relevant content
- Accepted Answerasked 2 months ago
- Accepted Answerasked 9 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Ok, but I have got the port 443 opened. I also tried to override the default endpoint in my java app to the email-smtp.eu-central-1.amazonaws.com, however it didn't help.