noximus
6/2/2015 - 9:01 PM

Proper PHPMailer Bluehost Gmail submission

Proper PHPMailer Bluehost Gmail submission

After a little research, I was able to answer my own question

1. login to bluehost.com and access cPanel
2. in the "Mail" box, select "Email Accounts"
3. look for the desired email account and click "More" 
4. click "Configue Email Client"

You will now see the info you need to configure phpmailer. It will look something like this:

Manual Settings
Mail Server Username: username@domainname.com
Incoming Mail Server: mail.domainname.com
Incoming Mail Server: (SSL) box###.bluehost.com
Outgoing Mail Server: mail.domainname.com (server requires authentication) port 26
Outgoing Mail Server: (SSL) box###.bluehost.com (server requires authentication) port 465
Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS)
Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)

Using this info you configure phpmailer like this:

$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "box###.bluehost.com"; // sets the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "username@domainname.com"; // SMTP account username
$mail->Password = "userpassword"; // SMTP account password