Prestashop AWS SES contact us from email address

By default Prestashop sends messages submitted from the contact us form, with the customers email address as the from address. On a default installation using the PHP Mail function this will work, although messages will probably go straight into the spam folder.

Changing this to use AWS SES for example, requires you change Advanced Parameters -> Email. Adding the SES SMTP server with the generated username and password, encryption SSL and setting the port to 465.  This will send the email from SES, but SES will block the email if you haven’t registered the from address. So when a customer sends a form it will always fail.

The solution to this is editing /controllers/front/ContactController.php around line 131, simply change the Mail::Send function to use $contact->email instead of $from.

Prestashop will now send emails from the shops contact email to the same email address. – Make sure that the shops contact email is authorised to send emails in SES.

Leave a Reply

Your email address will not be published. Required fields are marked *