creative_mazhar
creative_mazhar

Reputation: 39

What should be the PHPMailer settings for GoDaddy for sending email?

What will be the settings for the godaddy for sending email?

$mail->isSMTP(); 
$mail->Host = 'mail.trottolaw.com'; 
$mail->SMTPAuth = true;    
$mail->Username = '[email protected]';
$mail->Password = 'my password';  
$mail->SMTPSecure = 'tls'; 
$mail->Port = 587;                
$mail->addReplyTo('[email protected]','Mazhar');
$mail->setFrom('[email protected]', 'Mazhar');
$mail->addAddress('[email protected]', 'Mazhar');   
$mail->addAddress('[email protected]');  

I was expecting it to send email but it's not sending any email and also not giving any error message.

Upvotes: 3

Views: 5773

Answers (3)

BGS
BGS

Reputation: 1441

Just got off the chat with GoDaddy tech. Here is the settings for PHPMailer for cPanel users:

$mail->Host = "localhost";
$mail->Port = 25; 
$mail->SMTPSecure = false;
$mail->SMTPAuth = false;

and Plesk users (I use plesk and have GoDaddy's outlook email account with them):

$mail->Host = "relay-hosting.secureserver.net";
$mail->Port = 25; 
$mail->SMTPSecure = false;
$mail->SMTPAuth = false;

Add/re-add an SPF record v=spf1 include:secureserver.net -all and wait 24-48h

godaddy docs

It helped me, i.e. it started sending but to Spam folder. I waited just 4h and tried it again and it went to inbox! Tried yahoo and gmail, both were fine!

Hope it helps

Upvotes: 0

Synchro
Synchro

Reputation: 37710

Search before you post; This has been asked and answered many times before. Also, why would you not look at GoDaddy's support area before posting here?

GoDaddy blocks outbound SMTP; you cannot use any SMTP servers other than GoDaddy's own. This also means you usually cannot use your own email addresses as from addresses because it will cause SPF failures (unless you add GoDaddy to your SPF, which isn't a good idea).

To send through GoDaddy's servers, either do not use SMTP at all (which means that PHPMailer will fall back to using mail(), which will send via localhost, and that works with GoDaddy's shared hosting), or use these settings:

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

You don't need to provide a username or password as it allows access from shared hosts automatically.

You can also do this by setting $mail->Host = 'localhost', but if you do that you also need to set $mail->SMTPAutoTLS = false because GoDaddy's local server advertises STARTTLS, but it will fail because its certificate won't match localhost.

PHPMailer's troubleshooting guide has a section on GoDaddy.

Upvotes: 3

NewOnStackoverflow
NewOnStackoverflow

Reputation: 69

I also went through the same issue of mails not being sent and recieved from Godaddy. The following steps solved my issue:

1) Go to Cpanel
2) Click on MX Entry under Email Section
3) Check Email Routing
4) If you are using Cpanel emails then you need to select Local Mail Exchanger and If you are using Google or any external email service then you need to select Remote Mail Exchanger.

Upvotes: 1

Related Questions