Configure SMTP for Amazon SES

thumbnail
Jonatan Oyola, modified 13 Years ago. Regular Member Posts: 193 Join Date: 6/6/07 Recent Posts
I've configure Liferay to send mails via SMTP using Amazon SES.

portal-ext.properties

mail.session.mail.smtp.auth=true
mail.session.mail.smtp.host=email-smtp.us-east-1.amazonaws.com
mail.session.mail.smtp.port=465
mail.session.mail.smtp.user=******************
mail.session.mail.smtp.password=******************
mail.session.mail.transport.protocol=smtps


Liferay adds the following properties automatically when the protocol is smtps

mail.smtps.socketFactory.port=465
mail.smtps.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtps.socketFactory.fallback=false


Also I've added the advance properties

mail.smtps.ssl.enable=true
mail.smtps.starttls.enable=true


The mails never reach their destination, and in the logs I find the following message

Failed to connect to a valid mail server. Please make sure one is properly configured. Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465


Can anyone help?

Thanks on advances
Ranjit Victor, modified 13 Years ago. New Member Post: 1 Join Date: 12/19/12 Recent Posts
This is what I tried and it worked.

mail.session.mail.transport.protocol=smtp
mail.session.mail.smtp.ssl.enable=true
mail.session.mail.smtp.starttls.enable=true
mail.session.mail.smtp.auth=true
mail.session.mail.smtp.host=email-smtp.us-east-1.amazonaws.com
mail.session.mail.smtp.port=25
mail.session.mail.smtp.user=<Smtp Username>
mail.session.mail.smtp.password=<Smtp Password>

Note: The SMTP username and password are the ones that get generated when creating SMTP Credentials from the AWS Console. This is different from the IAM credentials

Also make sure there are no firewall settings blocking access to the remote port 25
Daniel Guidry, modified 12 Years ago. New Member Posts: 2 Join Date: 5/7/13 Recent Posts
How do you configure the sender address when using Amazon SES? I'm completely unable to send any email through Liferay using SES because it keeps rejecting the email with error 554 Message rejected: Email address is not verified. I know for certain that the recipient email is verified (I'm still in the sandbox), but there is no way for me to configure the sending email. When creating SMTP credentials in AWS there is no way to specify the associated email address there either.

How did you get it to work?

Thanks,
Daniel
Daniel Guidry, modified 12 Years ago. New Member Posts: 2 Join Date: 5/7/13 Recent Posts
OK, I just found it. I had to go into Control Panel > Portal Settings > Email Notifications and set the sending address there to my SES verified sender. After doing that I was able to process outgoing email through SES.

Thanks,
Daniel