Jump to content

[SOLVED] Using Amazon SES SMTP service to send emails, doesn't work


Recommended Posts

Hi all,

 

I configured the SMTP to use Amazon's SES service, I've got everything set up correctly with the right SMTP server, user and password that I created inside Amazon's console. Also, I'm using TLS security because it's mandatory in Amazon.

 

The weird thing is, my test emails are delivered just fine (using the email configuration test tools at the bottom of the page), but then NO emails are delivered when users register on the website or make an order.

 

Has anyone successfully used Amazon SES?

From googling around I read that it might be a problem with an advanced TLS feature they use called STARTTLS, and apparently Prestashop's mail system doesn't support it.

 

 

Any thoughts?

Thanks

Edited by lorenzopierfelice (see edit history)
Link to comment
Share on other sites

After banging my head on the wall for an afternoon, I think I found the best way to use Amazon SES on Prestashop (other SMTPs will work too, like Mailjet or Gmail).

 

I figured the best thing to do was to keep using the PHP native mail() function, but replacing the underlying sendmail command with MSMTP, it worked great and it was very easy (on a Ubuntu server).

 

Follow this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-gmail-or-yahoo-with-php-mail-function

 

 

My SMTP mail was still not working, but thanks to this setup I was able to just tail the msmtp log and find out I had a problem:

tail -f /var/log/msmtp.log

This is the error I was getting:

Sep 30 22:46:51 host=email-smtp.eu-west-1.amazonaws.com tls=on auth=on user=XXXXXXXXXX [email protected] [email protected] smtpstatus=554 smtpmsg='554 Transaction failed: Local address contains control or whitespace' errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

I turns out you can't use most special characters in your pretty sender's address:

 

[Test sender name - Test test] <[email protected]>

 

This is illegal for any SMTP server that follow the RFC3696 specification

  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...