Using SMTP for outgoing mails (PHPMailer) on AWS instance?

I moved one of my wordpress site to an AWS instance. But once I got it working, noticed that none of the notifications or contact emails were being sent through.

On researching the issue, I found that if I set the SMTP server to be an external SMTP (my AWS instance doesn’t have one), it should work. I don’t need membership emails sent out from my site, just the contact form.

Read More

So I tried 2 different approaches

  1. Used the Configure SMTP plugin and configured it to route all emails via an SMTP account

  2. Using Custom Contact Forms plugin, specified SMTP the settings so emails are sent using SMTP settings in PHPMailer

None of these work. I am not getting any emails. The test email from Configure SMTP works but no emails are sent from the contact forms.

Can someone please help me with what might be wrong? Is any additional configuration needed when doing this via AWS?

Related posts

Leave a Reply

3 comments

  1. I had the same exact problem. I had a successful plugin installation and successful test email, but WordPress was still attempting to send mail via /usr/bin/sendmail. I confirmed this by checking my logs (/opt/bitnami/apache2/logs/error_log).

    To finally get up and running, I simply installed sendmail with the following commands:

    $ sudo apt-get update
    $ sudo apt-get install sendmail

    Which installed sendmail in /usr/sbin, so I created a symlink to complete the installation:

    $ sudo ln -s /usr/sbin/sendmail /usr/bin/sendmail

    Hope that helps.

  2. I agree with Eric, although I think postfix is even easier and won’t require the symlink:

    $ sudo apt-get update
    $ sudo apt-get install postfix
    

    You’ll be walked through configuration options for postfix then, but on every RedHat, Debian, Ubuntu, or Amazon Linux AMI I’ve used in the past couple of years, the OOTB setup of Postfix works just fine.