Configure SMTP for outbound emails

TIP: To configure the application to use the SMTP service provided by Amazon Simple Email Service (SES), refer to the guide on using Amazon SES.

NOTE: Amazon EC2 blocks SMTP port 25 by default on all Amazon EC2 instances, and you must manually request removal of this restriction to use this port.

The Bitnami WordPress Production-Ready Stack solution deploys instances on a private subnet and outbound traffic is limited to HTTP and HTTPS traffic on ports 80 and 443 exclusively.

TIP: Refer to the architecture page for more information about the subnets and security improvements available in this solution.

To configure SMTP for outbound emails, you need to modify the corresponding security group to allow outbound SMTP traffic on the port used by your SMTP server, as follows:

  • Log in to the AWS VPC console.

  • Under the “Security” menu, click the “Security Groups” link to display the available security groups.

    Obtain Bastion IP

  • Select the security group for your WordPress Production-Ready stack. By default, this security group has the same name as your stack and the description “App Server Security Group”. Then, click the “Outbound Rules” tab in the lower panel and click the “Edit Rules” button.

    Obtain Bastion IP

  • In the “Edit outbound rules” page, click “Add Rule” and add a new rule to open outbound SMTP traffic using the values below:

    • Type: Custom TCP Rule
    • Port Range: PORT_TO_OPEN (please note you need to replace the placeholder PORT_TO_OPEN with your SMTP server port, e.g. 587)
    • Destination: Custom / “”

    Obtain Bastion IP

  • Click the “Save rules” button to update the outbound rules.

You can activate and test the “WP Mail SMTP” plugin from the WordPress administration page as follows:

  • Log in to the WordPress administration panel.

  • Navigate to “Plugins” and click the “Activate” option for the “WP-Mail-SMTP” plugin.

    Activate WP-Mail-SMTP

  • Go to the “Settings -> WP Mail SMTP” panel and the “Settings” tab to configure the SMTP settings of your email provider. Select “Other SMTP” as the mailer.

    Mailer selection

  • Here is an example of configuring WordPress to use a Gmail account. Replace USERNAME and PASSWORD with your Gmail account username and password respectively.

    • SMTP Host:

    • SMTP Port: 587

    • Encryption: TLS

    • Authentication: On

    • SMTP Username:

    • SMTP Password: PASSWORD

      WordPress SMTP Options

    If you are using a different provider, remember to replace these values with the valid data for your SMTP provider.

  • Click “Save Settings” to save the changes.

  • Send a test email using the “Email Test” tab to ensure that everything is working smoothly.

To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid, refer to the FAQ.

NOTE: If you are using Gmail as the outbound email server, your application’s attempts to send outgoing emails may be blocked by Gmail if it considers the authentication attempts to be suspicious. When this happens, you will receive a Gmail security alert at the corresponding Gmail address. To proceed, you will need to manually confirm the validity of the authentication attempt before Gmail will permit the application to send outbound emails. For more information on this and other Gmail issues related to outbound email from your application, refer to our Gmail SMTP troubleshooting page.

Last modification November 17, 2020