WP-Mail-SMTP in WordPress Hosted by Bluehost

WP-Mail-SMTP in WordPress Hosted by Bluehost

I had problems figuring out how to make the WP Mail SMTP plugin work in my WordPress blog and I almost gave up because most of the people seem to have no issues with it.

Here’s my scenario, I have installed a wordpress blog in a website hosted by Bluehost. The email part of my domain is handled by Gmail. I want to use this email address to send emails to my subscribers as opposed to the default address, xxxx@xxxx.bluehost.com.

If after installing and activating the WP-mail-smtp plugin, you encounter this kind of error when you send a test mail:

["sign_cert_file"]=>
string(0) “”
["sign_key_file"]=>
string(0) “”
["sign_key_pass"]=>
string(0) “”
}

The SMTP debugging output is shown below:

SMTP -> ERROR: Failed to connect to server: Connection timed out (110)

this maybe caused by the MX configuration of your webhosting company. I am going to share how I have fixed my problem. This solution is a derivative of WPBeginner’s post about How to Send Email in WordPress using the Gmail SMTP Server.

This is only applicable if your wordpress blog is hosted by Bluehost or Hostmonster.

1. First of all, go to the CPanel of your bluehost account. Click the MX Entry icon under the Mail groupbox.

2. You will be redirected to DNS Zone Editor, find the MX (Mail Exchanger) section.

3. Click the more >> link.

4. Select Remote Mail Exchanger, by default this is set to Automatic Detect Configuration.

5. Go back to the CPanel and under Email Accounts create a new email that is similar to the email address you’d like to use in the wp-mail-smtp plugin.

6. Go the administration page of your WordPress blog.

7. So after installing and activating, go to Installed Plugins -> WP-Mail-SMTP -> Settings.

8. Fill in the From email and the From Name, please refer to the screenshot below.

9. The tricky part is on the SMTP options, you need to set your SMTP host to boxXXXX.bluehost.com where XXXX is the number used for your web. The password that you will use here is the password you used when you created the email account in the CPanel. Please refer to Step 5.

10. Click Save Changes.

11. Send a test mail and hopefully it works! :)

To give credit whom it is due: thanks to WPBeginner.com, Marcuswickes for the bluehost tip, and Callum Macdonald for the wonderful plugin.

I'd love to connect with you in:
twitter: @aldrin002
instagram: aldrin002
facebook: aldrin002
linkedin: aldrin aquisap

  • Pingback: hcthomas on "[Plugin: Contact Form] Sorry, email message could not be delivered." | Wordpress Problems & Erros - How to fix

  • Joseph Koech

    Thanks Aldrin, this helped me out!

    • aldrin aquisap

      You are welcome Joseph! :)

  • John Beans

    Have you had any trouble with HTML emails getting mangled? Did you have to edit your php.ini to have emails look okay?

  • Trevor

    I had spent a lot of time searching for a solution to my unique situation and your guide was the only one that did it for me! Thanks!

    • http://aldrin.aquisap.info aldrin

      You’re welcome Trevor! :)

  • http://oldmankit.com/ Kit Johnson

    Thank you! Thank you! Thank you!

    • http://aldrin.aquisap.info aldrin

      You’re welcome Kit!

  • Alan Kimrey

    Many thanks!

    • http://aldrin.aquisap.info aldrin

      No problem man. :)

  • Fahad Quraishi

    Thank you! Was having this issue for a bit and this is what fixed it.

    • http://aldrin.aquisap.info aldrin

      You’re welcome Fahad! Glad I could help.

    • aldrin aquisap

      You’re welcome! :)

  • Anisa

    I did all the steps correctly but still its given me this error
    The result was:
    bool(false)

    The full debugging output is shown below:
    object(PHPMailer)#270 (69) {
    ["Version"]=>
    string(5) “5.2.7”
    ["Priority"]=>
    int(3)
    ["CharSet"]=>
    string(5) “UTF-8″
    ["ContentType"]=>
    string(10) “text/plain”
    ["Encoding"]=>
    string(4) “8bit”
    ["ErrorInfo"]=>
    string(22) “SMTP connect() failed.”
    ["From"]=>
    string(26) “support@propertychoice.net”
    ["FromName"]=>
    string(23) “Property Choice Support”
    ["Sender"]=>
    string(0) “”
    ["ReturnPath"]=>
    string(0) “”
    ["Subject"]=>
    string(53) “WP Mail SMTP: Test mail to support@propertychoice.net
    ["Body"]=>
    string(68) “This is a test email generated by the WP Mail SMTP WordPress plugin.”
    ["AltBody"]=>
    string(0) “”
    ["Ical"]=>
    string(0) “”
    ["MIMEBody:protected"]=>
    string(69) “This is a test email generated by the WP Mail SMTP WordPress plugin.

    ["MIMEHeader:protected"]=>
    string(475) “Date: Wed, 1 Oct 2014 10:14:03 +0000
    Return-Path:
    To: support@propertychoice.net
    From: Property Choice Support
    Subject: WP Mail SMTP: Test mail to support@propertychoice.net
    Message-ID:
    X-Priority: 3
    X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit


    ["mailHeader:protected"]=>
    string(0) “”
    ["WordWrap"]=>
    int(0)
    ["Mailer"]=>
    string(4) “smtp”
    ["Sendmail"]=>
    string(18) “/usr/sbin/sendmail”
    ["UseSendmailOptions"]=>
    bool(true)
    ["PluginDir"]=>
    string(0) “”
    ["ConfirmReadingTo"]=>
    string(0) “”
    ["Hostname"]=>
    string(0) “”
    ["MessageID"]=>
    string(0) “”
    ["MessageDate"]=>
    string(0) “”
    ["Host"]=>
    string(19) “box121.bluehost.com”
    ["Port"]=>
    string(3) “465”
    ["Helo"]=>
    string(0) “”
    ["SMTPSecure"]=>
    string(3) “ssl”
    ["SMTPAuth"]=>
    bool(true)
    ["Username"]=>
    string(26) “support@propertychoice.net”
    ["Password"]=>
    string(12) “)LSIg!XRHv4H”
    ["AuthType"]=>
    string(0) “”
    ["Realm"]=>
    string(0) “”
    ["Workstation"]=>
    string(0) “”
    ["Timeout"]=>
    int(10)
    ["SMTPDebug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["SMTPKeepAlive"]=>
    bool(false)
    ["SingleTo"]=>
    bool(false)
    ["SingleToArray"]=>
    array(0) {
    }
    ["do_verp"]=>
    bool(false)
    ["AllowEmpty"]=>
    bool(false)
    ["LE"]=>
    string(1) ”

    ["DKIM_selector"]=>
    string(0) “”
    ["DKIM_identity"]=>
    string(0) “”
    ["DKIM_passphrase"]=>
    string(0) “”
    ["DKIM_domain"]=>
    string(0) “”
    ["DKIM_private"]=>
    string(0) “”
    ["action_function"]=>
    string(0) “”
    ["XMailer"]=>
    string(0) “”
    ["smtp:protected"]=>
    object(SMTP)#269 (12) {
    ["Version"]=>
    string(5) “5.2.7”
    ["SMTP_PORT"]=>
    int(25)
    ["CRLF"]=>
    string(2) ”

    ["do_debug"]=>
    bool(true)
    ["Debugoutput"]=>
    string(4) “echo”
    ["do_verp"]=>
    bool(false)
    ["Timeout"]=>
    int(10)
    ["Timelimit"]=>
    int(30)
    ["smtp_conn:protected"]=>
    bool(false)
    ["error:protected"]=>
    NULL
    ["helo_rply:protected"]=>
    NULL
    ["last_reply:protected"]=>
    string(0) “”
    }
    ["to:protected"]=>
    array(1) {
    [0]=>
    array(2) {
    [0]=>
    string(26) “support@propertychoice.net”
    [1]=>
    string(0) “”
    }
    }
    ["cc:protected"]=>
    array(0) {
    }
    ["bcc:protected"]=>
    array(0) {
    }
    ["ReplyTo:protected"]=>
    array(0) {
    }
    ["all_recipients:protected"]=>
    array(1) {
    ["support@propertychoice.net"]=>
    bool(true)
    }
    ["attachment:protected"]=>
    array(0) {
    }
    ["CustomHeader:protected"]=>
    array(0) {
    }
    ["lastMessageID:protected"]=>
    string(57) “”
    ["message_type:protected"]=>
    string(5) “plain”
    ["boundary:protected"]=>
    array(3) {
    [1]=>
    string(35) “b1_9559fa7c32a7f23a9a9883413fa7bb6c”
    [2]=>
    string(35) “b2_9559fa7c32a7f23a9a9883413fa7bb6c”
    [3]=>
    string(35) “b3_9559fa7c32a7f23a9a9883413fa7bb6c”
    }
    ["language:protected"]=>
    array(18) {
    ["authenticate"]=>
    string(35) “SMTP Error: Could not authenticate.”
    ["connect_host"]=>
    string(43) “SMTP Error: Could not connect to SMTP host.”
    ["data_not_accepted"]=>
    string(30) “SMTP Error: data not accepted.”
    ["empty_message"]=>
    string(18) “Message body empty”
    ["encoding"]=>
    string(18) “Unknown encoding: ”
    ["execute"]=>
    string(19) “Could not execute: ”
    ["file_access"]=>
    string(23) “Could not access file: ”
    ["file_open"]=>
    string(33) “File Error: Could not open file: ”
    ["from_failed"]=>
    string(35) “The following From address failed: ”
    ["instantiate"]=>
    string(36) “Could not instantiate mail function.”
    ["invalid_address"]=>
    string(15) “Invalid address”
    ["mailer_not_supported"]=>
    string(25) ” mailer is not supported.”
    ["provide_address"]=>
    string(54) “You must provide at least one recipient email address.”
    ["recipients_failed"]=>
    string(45) “SMTP Error: The following recipients failed: ”
    ["signing"]=>
    string(15) “Signing Error: ”
    ["smtp_connect_failed"]=>
    string(22) “SMTP connect() failed.”
    ["smtp_error"]=>
    string(19) “SMTP server error: ”
    ["variable_set"]=>
    string(30) “Cannot set or reset variable: ”
    }
    ["error_count:protected"]=>
    int(2)
    ["sign_cert_file:protected"]=>
    string(0) “”
    ["sign_key_file:protected"]=>
    string(0) “”
    ["sign_key_pass:protected"]=>
    string(0) “”
    ["exceptions:protected"]=>
    bool(true)
    }

    The SMTP debugging output is shown below:
    SMTP -> ERROR: Failed to connect to server: Connection timed out (110)

  • Pingback: Gregory Smith

    • http://aldrin.aquisap.info aldrin

      Thanks Gregory! :)

Shop is coming soon...

%d bloggers like this: