SMTP Mailer Plugin For WordPress

SMTP Mailer is the easiest SMTP plugin for WordPress. It allows you to configure an SMTP server to send email from your website. SMTP Mailer enhances the default WordPress mail (“wp_mail”) function by letting you connect to a remote SMPT server to send an email instead of doing it from your web server. This reduces heavy load from your server and increases email deliverability.

Requirements

  1. A self-hosted WordPress site running on a WordPress Optimized Environment.
  2. One of port 587, 465 or 25 needs to be open. If they are all blocked you may not be able to send an email via SMTP. In that case, they should advise which port you can use to connect to the remote SMTP server.
  3. Your Web host needs to allow communication with an external SMTP server. If that’s not possible they should be able to provide information on their own SMTP server.

SMTP Mailer Plugin Demo

SMTP Mailer Installation

You can install the SMTP plugin like any other WordPress plugin.

Option 1 (Quick & Easy install)

  1. Go to Plugins->Add New from your WordPress admin dashboard
  2. Search for SMTP Mailer
  3. Click Install once you have found it

Option 2 (Manual install)

  1. Download the zip version of the plugin
  2. Go to Plugins->Add New
  3. Click Upload Plugin
  4. Select the zip file on your computer
  5. Install it

Option 3 (FTP install)

  1. Download the zip version of the plugin
  2. Extract it on your computer
  3. Connect to your site via FTP
  4. Browse to “/wp-content/uploads/plugins/” directory
  5. Upload the folder that contains the main plugin files

SMTP Mailer Settings

You will need to configure your SMTP server related information in order to send email from your website. In order to access the settings menu go to “Settings->SMTP Mailer” from your admin dashboard.

SMTP Mailer WordPress plugin menu

The settings menu comes with three separate tabs – General Settings, Test Email & Server Info.

General Settings

screenshot of SMTP Mailer plugin settings

SMTP Host

Your outgoing mail server which will be used for sending email (e.g. smtp.gmail.com).

SMTP Authentication

Enable/Disable SMTP authentication when sending an email (Supported values: True/False).

SMTP Username

The username to connect to your SMTP server. You will need to provide a username if you enable “SMTP Authentication”.

SMTP Password

The password to connect to your SMTP server. You will need to provide a password if you enable “SMTP Authentication”.

Type of Encryption

The encryption which will be used for sending an email (Supported values: TLS/SSL/No Encryption. TLS is recommended).

SMTP Port

The port which will be used when sending an email (587/465/25). If you choose TLS the port should be set to 587. For SSL use port 465 instead.

From Email Address

The email address which is be used as the From Address if it is not supplied to the mail function.

From Name

The name which will be used as the From Name if it is not supplied to the mail function.

Test Email

“Test Email” menu allows you to test the functionality of the plugin after you have configured everything.

screenshot of test email menu in the SMTP Mailer plugin

Server Info

“Server Info” menu displays some technical information regarding your server. This is very useful for troubleshooting.

Outgoing Mail Server Configurations

Here are the settings for all the popular outgoing mail (SMTP) servers.

Gmail

  1. SMTP Host: smtp.gmail.com
  2. SMTP Authentication: True
  3. SMTP Username: Either your Gmail account username or full email address
  4. SMTP Password: Your Gmail account’s password
  5. Type of Encryption: TLS or SSL
  6. SMTP Port: 587 (if TLS) or 465 (if SSL)

Troubleshooting

1.For security reasons, Gmail now blocks any incoming connection to its SMTP server. In order to make a connection to the Gmail SMTP server and send email, you will also need to allow less secure apps in your account.

If you do not wish to turn on this feature, you might want to take a look at my Gmail SMTP plugin.

2.When you are sending an email for the first time via SMTP, you might get this SMTP Error: “Could not authenticate“.

In order to fix this issue login to your Gmail account first. You should see a security warning from Gmail upon login – “Your account has been hacked” or “Somebody stole your password”. As soon as you confirm that it was you who tried to login (Just click on the link that shows up in that message), the plugin should be able to connect to the Gmail SMTP server.

Yahoo

  1. SMTP Host: smtp.mail.yahoo.com
  2. SMTP Authentication: True
  3. SMTP Username: Your full Yahoo email address
  4. SMTP Password: Your Yahoo email account’s password
  5. Type of Encryption: TLS or SSL
  6. SMTP Port: 587 (if TLS) or 465 (if SSL)

Outlook

  1. SMTP Host: smtp-mail.outlook.com
  2. SMTP Authentication: True
  3. SMTP Username: Your email address
  4. SMTP Password: Your password
  5. Type of Encryption: TLS
  6. SMTP Port: 25 or 587 (if port 25 is blocked)

SendGrid

  1. SMTP Host: smtp.sendgrid.net
  2. SMTP Authentication: True
  3. SMTP Username: Your SendGrid username
  4. SMTP Password: Your SendGrid password
  5. Type of Encryption: TLS
  6. SMTP Port: 587 (if TLS) or 465 (if SSL). If you select “No Encryption” use port 25 instead.

Mandrill

  1. SMTP Host: smtp.mandrillapp.com
  2. SMTP Authentication: True
  3. SMTP Username: Your Mandrill username
  4. SMTP Password: Your Mandrill password
  5. Type of Encryption: TLS
  6. SMTP Port: 587, 25 or 2525 (if TLS or No Encryption). For SSL use port 465.

GoDaddy

  1. SMTP Host: relay-hosting.secureserver.net
  2. SMTP Authentication: False
  3. Type of Encryption: No Encryption
  4. SMTP Port: 25

Office 365

  1. SMTP Host: smtp.office365.com
  2. SMTP Authentication: True
  3. SMTP Username: Your office365 username
  4. SMTP Password: Your office365 password
  5. Type of Encryption: TLS
  6. SMTP Port: 587

If you have any questions feel free to share it in the comment section.

Disclosure: This page may contain affiliate links. If you follow one of those affiliate links and purchase something it will provide me with a little bit of a commission. This costs you nothing extra but helps maintain my site, free plugins, and themes. So I thank you for your support.

127 thoughts on “SMTP Mailer Plugin For WordPress”

  1. Hi,
    I just tried your plugin with GMAIL and O365, but it won’t work :-/
    Both tests failed.

    Reply
    • @Montegnies, What error do you get?

      Reply
  2. Hello,

    I keep getting error:

    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Permission denied)
    SMTP ERROR: Failed to connect to server: Permission denied (13)

    I’ve turned less secure apps on and i’ve tried both SSL and TLS.

    The username and password are correct too

    Reply
  3. With php 7.3 the plugin is not working.
    no mail are sent, no error messages, nothing inside logs.
    do you have some suggestion?

    Reply
  4. Hey, the plugin seems to be working well, but it keeps giving the message “SMTP Mailer plugin cannot send email until you enter your credentials in the settings.” at the top in the dashboard. That’s kind of annoying.

    Reply
    • @MVG, This is to make sure you have configured all the options in the settings. If you keep the plugin active in a non-working state your website may not be able to send any email.

      Reply
  5. Hi – I have a website with a number of contact forms, set up so as to send emails from various different email addresses.

    Could I use SMTP Mailer to send emails from a different email address for each form? Are there any restrictions on the number of email addresses I could send from?

    Many thanks in advance!

    Reply
    • @Chas, It depends on the SMTP provider. I know that Gmail doesn’t let you use a different “from email” for security reasons.

      Reply
    • Chas,

      What’s a SMPT server 🙂

      Reply
  6. What after test mails? Don’t we have to do anything to allow post notifications to our followers?

    Reply
    • @Rajan, With Test email you can check if the plugin is working on your site.

      Reply
  7. I have 2 contact forms. I have 3 emails these forms need to go to but only 1 is getting the email. I have everything set up properly (I think) I am getting the error: SMTP Mailer plugin cannot send email until you enter your credentials in the settings.
    My new host company says they set it up already. What am I missing here? Everything is set up exactly how you have it! Frustrating!!!!!

    Reply
    • @Jennifer, Have you send a test email to see if it works?

      Reply
      • I have. The test emails work perfectly. It’s the emails connected to the contact forms that’s not going through. I keep getting the STML error message.

        Reply
  8. Hi,
    I just tried your plugin with O365, but it won’t work.
    Test failed.
    SMTP Error: data not accepted.

    Reply
  9. Super Good stuff

    Reply
  10. I’ve installed and tested this plugin on my wordpress and works perfect but I’m having an issue with woocommerce emails. For example, when an order is made on my site, woocommerce is configured to send an email to me and to the customer, but the email is never sent or at least it’s never delivered. Does anyone knows what could be happening? Thanks in advance!

    Reply
    • Thanks for your insight. Do you happen to know how to add a pdf, make it fillable, or printable, with the capability to email it back… oh and to be able to add an attachment (like a fillable resume with the option to attach a resume)????

      Reply
    • Hi Daniel
      I need help on this as well, experiencing same problem. did this ever get resolved and what did you do to make it work?
      Thanks

      Reply
  11. I have followed what you have mentioned but am getting the below error.
    5.7.3 Authentication unsuccessful [BL0PR01CA0034.prod.exchangelabs.com]

    even the user name password is correct.
    also tried other plugins to nothing works.
    If I have enabled two-factor authentication case this problem?
    How to check the 25 and 587 ports are open or not? -I have doubts about this step only. May our hosting provider block this port?
    Please help me to fix this issue.
    Thanks,
    Saravanan

    Reply
    • @Saravanan, Who is your SMTP provider? Do they have instructions on this?

      Reply
      • Have you checked with your hosting company? I know that the WordPress update made all my java and jQuery unstable, so I had to install a new plugin to fix this.
        In regards to your mail check with your hosting company to make sure your incoming POP3 or STMP and your outgoing STMP match…. It even has to match the hosting companys IP address when setting up.
        I know that was my problem along with a silent fail in my contact form which I had to replace in contact form 7. My original problem still exists only one person gets the email in contact form 7 and I’m still not sure why. I hope that helps.

        Reply
  12. Hi,

    I set “From Email Address” to: no-reply@mywpwebsite.com but the email sent from WP were from mail@mywpwebsite.com.

    Could you make force “From Email Address” to be used on any email sent from WP website?

    Best regards,
    Choco

    Reply
  13. Many Thanks. It works for me (with AWS SES SMTP).

    Reply
  14. the test works even though it shows me an error, the mails get to the final destination. But the emails sent from the contact form in my page are still not being sent… Should I connect this plugin to my contact form? how can i do that? I’m currently using ninja forms and in other websites I use contact form 7

    Reply
    • @Lau, There is nothing to connect. If your contact form uses the “wp_mail” function for sending an email SMTP Mailer will automatically apply your SMTP credentials. Have you tried the “Test Email” functionality in the plugin?

      Reply
  15. Hi, I’m moving to SendGrid API my client’s website (from Mandrill). Formidable forms is still sending from the old “send” address with MailChimp… how do I get Formidable Forms to recognize that the outgoing information has changed? I’m not sure where I’m going wrong.. thanks!

    Reply
    • @Isla, Have you updated the credentials in the SMTP Mailer settings?

      Reply
  16. Formidable Forms recommends a different plugin, but I wanted to try this one first.

    Reply
    • @Isla, You can try the plugin they recommend. I’m not sure how it’s possible to use your old credentials when you have already updated it. Does your website cache database options?

      Reply
      • Hi Noor,
        I solved it in the end, I’m not sure how, but it’s working. Thanks!

        Reply
  17. I tried with a custom gmail account. but it failed.
    then I tried with godaddy’s settings, also error.

    2021-02-19 19:29:27 Connection: opening to relay-hosting.secureserver.net:25, timeout=300, options=array()
    2021-02-19 19:29:28 Connection failed. Error #2: stream_socket_client(): unable to connect to relay-hosting.secureserver.net:25 (Connection refused) [/home/*************/public_html/wp-includes/PHPMailer/SMTP.php line 375]
    2021-02-19 19:29:28 SMTP ERROR: Failed to connect to server: Connection refused (111)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Reply
    • @pico, Port 25 seems blocked. Please contact GoDaddy to see what configuration you should be using for your hosting account. You can also check this link: https://www.godaddy.com/help/send-form-mail-using-an-smtp-relay-server-953

      Reply
  18. On a wordpress server with multiple ip addresses, sometimes an inappropriate address is chosen for the connection, causing problems with server names in the message headers. To solve this, you can modify the $phpmailer->SMTPOptions to include the address to bind the socket to.


    // get the ip address for the website we are sending from
    $bound_ip = gethostbyname($_SERVER['SERVER_NAME']); // get the server name from PHP

    //disable ssl certificate verification if checked
    if(isset($options['disable_ssl_verification']) && !empty($options['disable_ssl_verification'])){
    $phpmailer->SMTPOptions = array(
    'ssl' => array(
    'verify_peer' => false,
    'verify_peer_name' => false,
    'allow_self_signed' => true
    ),
    'socket' => array(
    'bindto' => "$bound_ip:0"
    )
    );
    } else { // set the options to use our ip address, instead of the first one on this server
    $phpmailer->SMTPOptions = array(
    'socket' => array(
    'bindto' => "$bound_ip:0"
    )
    );
    }

    Reply

Leave a Reply to Montegnies Cancel reply