WordPress Notifications not working on Amazon EC2

Wondering if anyone else is running into this issue. I'm fairly new to Amazon AWS, but my team and I recently built and moved all of our WordPress sites over to a new EC2 instance for scaling WordPress. I've utilized many of the WPMU plugins here to launch our own WP networks. Then I noticed a few days ago that none of my contact forms we working on any of our WP sites. I then noticed that the standard WP notifications (when creating new sites, or using the "Forgot Password" link) were not sending emails either.

I went through a few days of troubleshooting - disabling plugins, updating WordPress, even installing a fresh version of WP, even installed a completely new WP website under a new domain name. Nothing seems to fix the problem.

I have a few support emails and posts out to various sources, but I wanted to try here as well because it seems we are all more 'seasoned' WP users and know a bit more about the development/technical aspect of running WP, networks, etc. Maybe someone else is/has experienced this problem with Amazon AWS and can help?

Much thanks in advance!

  • Philip John
    • DEV MAN’s Apprentice


    There are a few members here using the likes of AWS so hopefully they'll see this and chime in.

    Obvious things to do as far as I can see is ensure that PHP is able to send mail. Try writing a simple script to send a test e-mail. If that doesn't work you know that PHP can't send e-mail.

    Then you can check the SMTP server etc....


  • Barry
    • DEV MAN’s Mascot

    Make sure you have installed a mail server on your instance so you can actually mail out, or have set up you WP install to use smtp and are pointing it to an external smtp server. Then make sure you haven't blocked outgoing traffic on your mail servers port (25 I think).

  • borellidesigns
    • Flash Drive

    @Chris - I'm 99.9% positive phpmailer is turned on, but I will check now.

    @Phil - My thoughts exactly. That's why I figured I'd ask here as well. It's not really a WPMU Dev issue, but I'm certain there are several members who might be using AWS, or who plan to use AWS in the future. So hopefully this will help the community

    @Barry - I do not believe we have a mail server installed on our instance, so I will check into this, and also will check the ports to make sure we're not blocking outgoing traffic.

    Thanks guys for the advice! I'll keep you posted on what we find!


  • borellidesigns
    • Flash Drive

    Still no luck:slight_frown:

    My server admin confirmed that the mail function for PHP is installed. He also unblocked port 25. Here is the PHP info file:

    We also created a test PHP test form (http://binksites.com/testform/contact.php). This will send a submission to an email address setup on this server through the ISPConfig control panel. But, changing the TO email address to an address outside this server does not get sent....even though I get a 'successful' response.

    This obviously will not work for WordPress, because if a new user registers, they will never receive their new username and password.

    So the conclusion at this point is that we can send emails within the EC2 instance, but cannot send email outside of the instance.

    Still frustrated and looking for solutions:slight_frown:

  • borellidesigns
    • Flash Drive

    Hi Phil,
    That's what is sounds like. We're currently looking into setting up and external SMTP to send mail through. I'm receiving a lot of feedback concerning SPAM issues with AWS IP addresses. So possibly the easiest and most secure solution is to utilize an external SMTP service.....like SendGrid.

    I should have more info to provide here in the next few days as we venture down this route. I'm trying to keep this topic updated on our findings (both trial and errors). There's not a lot of info out there or setting up AWS for running WPMU, so I'm hoping we can find some solutions and help others through this topic.

    More info shortly....

  • borellidesigns
    • Flash Drive

    Alright guys...I have some good news. I was able to get mail sending out of the EC2 instance. So now, all of the WordPress notifications work properly and all my contact forms work properly.

    I started by setting up an external SMTP account with SendGrid. Then, I installed an SMTP plugin found from the WordPress plugin directory. Once configured this plugin worked great for the main blog, but the problem was that it had to be configured for every site in our MU installation....not practical in our situation.

    So, I wrote a 'barebones' version of this plugin to specify the configuration once and 'Network Activate' to have it work on all sites within the MU installation.

    After installing my plugin and 'Network Activating' the plugin, all contact forms, and all WordPress notifications now work properly on ALL blogs within our MU network!

    We're still going to try installing postfix as an alternative solution to this issue. I'll try using this as the method on a separate WPMU network any update this thread with results on that. I know postfix can also be modified to use SMTP rather than the default phpmailer so that's an option as well.

    Thanks for all your help with this guys! More to come over the next few days...

  • borellidesigns
    • Flash Drive

    Alright guys. So we messed with this all week and still no luck. We have postfix installed and working. As I said before we are able to send emails inside the instance, but nothing is being delivered outside of the instance.

    Upon checking the logs, it looks like we're getting a ton of 550 errors, and other types of 'undeliverable' errors from receiving email servers. It seems to be holding true that AWS instances, specifically IP addresses, and being blocked as spam.

    So, we've decided to go with the safer and more reliable route for our WordPress install on EC2 instance. We're using an external SMTP mail server outside of the instance, and have modified the normal WordPress email route to send through SMTP.

    There are a number of SMTP plugins in the WP repository, but none seemed to work across MU without setting up the plugin on each individual MU site.

    @Phil - I'd be happy to submit this plugin for review/release here within the community.

    We wanted a more automated approach, so we wrote a simple plugin that changes the normal mail routes to SMTP across all WPMU sites.

    For the SMTP service, we chose SendGrid, as they have a free tier where you can send up to 200 emails per day. This is great for starter sites, low traffic sites, and smaller MU networks. You'll obviously need more if you're receiving higher levels of traffic to your site; especially higher site registrations and lots of comments.

    So that is our solution to sending emails and normal WP notifications from our AWS instance. We can probably call this one resolved unless anyone else has input.

    Thanks again for all your help guys! I hope this helps anyone else having issues with setting up WordPress on an EC2 instance.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.