0

I've been researching for 3 weeks now on how to configure SMTP using PHPMailer for GoDaddy but none of it works. Tried contacting the GoDaddy support but they haven't replied yet. And I haven't seen any documentation on how to setup SMTP on their server.

I've been changing the Host many times, tested them, but none of it were successful in sending the email. I surpassed the error (using PHPMailer debug) but when I checked the email, I couldn't see any messages being received.

These are the hosts I've tried:

$mail->Host = "smtp.office365.com";
$mail->Host = "smtpout.secureserver.net";
$mail->Host = "relay-hosting.secureserver.net";
$mail->Host = "localhost";

Also, I've tried the settings in PHPMailer troubleshooting, but it won't work.

$mail->isSMTP();
$mail->Host = 'relay-hosting.secureserver.net';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->SMTPSecure = false;

My current settings are:

$mail->isSMTP();
$mail->Host = "smtpout.secureserver.net";
$mail->Port = 80;
$mail->SMTPAuth = true;

//Enable SMTP debugging. 
$mail->SMTPDebug = 4;

//Provide username and password     
$mail->Username = "email@email.com";                 
$mail->Password = "password"; 

$mail->From = "email@email.com";
$mail->FromName = "From Name";

$mail->addAddress("email@email.com", "Name");

The email being used is the email created in GoDaddy which is Office 365 Email Essentials. Under Email & Office (Not Workspace Email or from cPanel). I'm using Economy Linux Hosting with cPanel package.

I'm new to GoDaddy so this problem is new to me. In some hosting providers like InMotion, I've never encountered this problem.

dbybanez
  • 55
  • 1
  • 6
  • You say GoDaddy's support did not reply withing 3 weeks? Em.... Either your question never reached them or you should change the hoster then, I'd say? What do you pay them for? – arkascha Dec 11 '16 at 09:27
  • You need to tell us more than "It doesn't work". Post your debug output. It's well known that GoDaddy has severe restrictions on outbound email - you will not be able to connect to any external mail server directly, you *must* go via GoDaddy's servers, as their docs say. If it's not working, you need to talk to them. This is not a code problem. – Synchro Dec 11 '16 at 09:36
  • `SMTP -> get_lines(): $str is "220-We do not authorize the use of this system to transport unsolicited, "` this is what it says in the debug. Now, I've updated my code and used localhost. – dbybanez Dec 11 '16 at 09:40
  • I would suggest u try to get this working using a gmail account for smtp first, then move on to other mail accounts. I made a wrapper for PHPmailer, take a look, maybe it might help you in terms of the working specifications : https://gist.github.com/craigvantonder/e0503be23fada59834fa7e31c73f78a1 – Craig van Tonder Dec 11 '16 at 10:35
  • @CraigvanTonder I've tried using both gmail and office 365 when setting it up in my local. But as soon as I transferred the files to the server, the email won't send or could not receive anything. – dbybanez Dec 11 '16 at 10:54
  • http://stackoverflow.com/a/25225972/2110294 I think @arkascha has a decent plan :-) – Craig van Tonder Dec 11 '16 at 11:18

1 Answers1

2

Godaddy made few changes the server relay setting. we don't need to separately mention the relay server settings anymore. following changes will works fine with PHPMailer.

$mail = new PHPMailer;

$mail->SMTPDebug = 0;

$mail->isSMTP();

$mail->Host = 'localhost';

$mail->Port = 25;

$mail->ssl = false;

$mail->authentication = false;

vignesh Subash
  • 2,577
  • 1
  • 11
  • 15