PHPMailer GoDaddy Server SMTP Connection Refused
Asked Answered
B

21

26

The other day I was experiencing some problems with my GoDaddy hosted site. I called their tech support, and the person that I spoke with suggested that my problems were related to the fact that I was on a Windows box and would be better served on a Linux box. Having no opinion on this, I agreed and they switched me over.

In the wake of that transition, my PHPMailer functionality has deserted me. I have had this working for months, so I know that my settings are accurate. I have confirmed with GoDaddy that the account I am trying to send out of has not changed from their perspective. No changes have been made on the user side (like a new password). Bottom line, the only thing that is different is that my site is now hosted on a Linux server. That's it.

So I assume that my PHPMailer difficulties must be related to that, since it is too much of a coincidence that a script that has worked for months fails at the exact moment that the server transition occurs. But why? I spent an hour with their tech support, and they see nothing wrong with the server settings. We verified my settings (just for fun). Everything looks good, but when I send an email, I get this error:

SMTP -> ERROR: Failed to connect to server: Connection refused (111)SMTP Connect() failed.

There are many posts about this type of error, and almost all of them relate to people getting set up for the first time who have mis-entered settings or omitted settings. However, I KNOW that my settings are complete and accurate since I've been using them successfully for months. I'll post them here just for completeness:

$mail = new PHPMailer();
$mail->IsSMTP();  //telling the class to use SMTP
$mail->isHTML(true);
$mail->Host         = "smtpout.secureserver.net"; //also tried "relay-hosting.secureserver.net"
$mail->WordWrap     = 50;
$mail->SMTPAuth     = true;
$mail->SMTPSecure   = "ssl";
$mail->Port         = 465;
$mail->Username     = "[email protected]";
$mail->Password     = *******;
$mail->Subject      = "Test Email";
$mail->SMTPDebug = 1;

Does anyone have any ideas why this might be happening? Is there some server setting that the tech support people might not be aware of, like maybe in my php.ini file? The guy I worked with did his best to help me out, but he may just not be aware of something.

Any help is appreciated. Let me know if there is any other information I can provide. Thanks!

EDIT: I should also mention some of the other attempts that I made. I get the same result no matter what.

1) TLS with port 587 2) Without SSL using ports 25, 80, and 3535. 2) My own gmail address modifying the server, username, password, etc.

Broody answered 18/2, 2014 at 0:7 Comment(3)
I'd start by trying to determine whether it's related to SSL or not. Does it work without SSL on a non-secure port, like 25, 80, 3535? If so, then the reason that it's not working with SSL on port 465 may be a certificate problem or a problem with the SSL cypher being used. If it doesn't work even without SSL, then there may be a problem with the way phpmailer is setup, or perhaps a firewall is not allowing outbound connections. In this case, I would try with a completely different SMTP server (such as smtp.gmail.com) to determine whether the problem is specific to smtpout.secureserver.netBenzophenone
Thanks @mti2935. I should have mentioned some of my other attempts. OP modified to show them. How would I modify the phpmailer setup? I don't see any setup customizations - only the class.phpmailer.php and languages/phpmailer.lang-en.php files. I also added ini_set("include_path", ".:/path/to/phpmailer/dir"); As for a firewall, I've changed nothing there, and this was working just fine before GoDaddy got a hold of it.Broody
Something may be blocking these outgoing connection attempts. Do you have access to the command line on this server? If so, can you try using telnet to connect to smtpout.secureserver.net on port 25, 80, or 3535; or to smtp.gmail.com on port 465? Do any of these attempts connect successfully?Benzophenone
H
41

As it seems this is a continuing problem, let me add my own experience.

Our website uses PHPMailer and the site is hosted on a GoDaddy linux server. The settings that seemed to be correct (according to everything I could find on SO and the goDaddy support site) were as follows:

SMTP_SERVER: smtpout.secureserver.net (or alternatively relay-hosting.secureserver.net)
SMTP_PORT: 465 //or 3535 or 80 or 25
SMTP_AUTH: true //always
SMTP_Secure: 'ssl' //only if using port 465

After spending 6+ hours trying every variation of ports(25, 3535, 4655), servers relay-hosting.secureserver.net,smtpout.secureserver.net:[port], etc.), usernames, passwords,etc. I called goDaddy. Another 40 minutes later, it was revealed that:

1) the "workspace" email accounts are being retired. That's important because if you have an email account with goDaddy today, you likely have a Workspace account. This is, according to the tech support rep, hosted separately from you linux account.

2) goDaddy is moving toward cPanel email accounts. Hurray! Time table? "...in the next 2 to 3 years!"

3) I moved our accounts from Workspace to cPanel accounts while I was on the phone with the rep. Really easy to do.

4) After you change your email accounts (including editing your MX records) to a cPanel email (vs. a "workspace" email) the appropriate settings for a web-form email using PHPMailer are:

SMTP_SERVER: localhost   //(and I mean literally: "localhost"- in place of smtp.secureserver.net and relay-hosting.secureserver.net, etc.)

... and everything else (as above) the same...

The webform I built with PHPMailer worked perfectly after this change!

Use your cPaneL email account login (username) and password in the PHPMailer setup and your web emails will work seamlessly!

An added bonus is that webmail (does anybody use this anymore?) can be accessed at [yourdoman]\webmail. No more cryptic url's to remember! And the accounts cand be IMAP or POP!

Admittedly, this means you must use goDaddy's cPanel email accounts, but getting the webform to work flawslessly with PHPMailer was the real reward!

Hurling answered 10/8, 2014 at 5:53 Comment(6)
Yes! This worked for me. Thank you! OP, please select this as the correct answer. No need to change from linux hosting.Heterosporous
This is one of the most important answers on SO. For email accounts made under the new GoDaddy CPanel: $mail->Host = "localhost"; That's huge!Brubeck
Per suggestions, I'm marking this as the correct answer to direct others to this post. However, I need to state that I have no way of personally verifying this this indeed works since I switched off of my linux server. Since others have had so much success with it, I'm deferring to their judgment. Seems appropriate.Broody
My contact form didn't work for over a year. Every attempt of getting it to work with GoDaddy, G Suite, and WordPress was a deadend... until this one. Thanks!Nipping
Thank you for this! Why the hell isn't this documented or at the very least relayed to their support staff? So frustrating, but thank you for the solution!Rai
I remember up voting this answer after getting my emails to work. but gone are those days too. This time the issue was with PhpMailer class. I updated it to 6.0.7 . and in it, there is this option $SMTPAutoTLS. and this defaults to TRUE. What this does (as per documentation) is, "Whether to enable TLS encryption automatically if a server supports it, even if SMTPSecure is not set to 'tls'." The godaddy support, as usual is ignorant of this update, and they will still do a demo of their "Test Script", by running it in our server, and prove to us that SMTP works just fine.Cady
G
46

I'm on GoDaddy on a Linux like @surfbird0713. On my 32nd attempt, the following worked for me as well:

$mail2->Host = localhost;
//$mail2->SMTPAuth = false;
//$mail2->Username = '[email protected]';
//$mail2->Password = '*******';

//$mail2->SMTPSecure = 'tls';

//$mail2->Port = 465;

I was previously trying with the username, login, port, etc. When I commented out all those, and just went with localhost it worked.

Gentle answered 10/1, 2015 at 8:22 Comment(7)
Wow.....i didnt expect this to work, ive tried everything. Tried this....worked perfectly...hahaha thats crazy.Afterwards
I totally didn't think this was going to work at all, but it did! I had these settings as well $mail->Port = 25; $mail->SMTPSecure = 'tsl';Truong
I don't understand it but after pounding sand for over an hour and then trying this, it worked! After reading globalSchmidt's post below I now understand.Hutt
That did work! haha Cannot believe that! I could vote up ten times!Chev
Thanks. You saved me from hours of headache.Zymometer
Nice! Setting host to localhost worked for me too. I needed these settings as well: $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); $mail->SMTPSecure = 'tls'; $mail->Port = 587;Bund
I spent 4hr before I found this "localhost" answer.. thank you sir!Barocchio
H
41

As it seems this is a continuing problem, let me add my own experience.

Our website uses PHPMailer and the site is hosted on a GoDaddy linux server. The settings that seemed to be correct (according to everything I could find on SO and the goDaddy support site) were as follows:

SMTP_SERVER: smtpout.secureserver.net (or alternatively relay-hosting.secureserver.net)
SMTP_PORT: 465 //or 3535 or 80 or 25
SMTP_AUTH: true //always
SMTP_Secure: 'ssl' //only if using port 465

After spending 6+ hours trying every variation of ports(25, 3535, 4655), servers relay-hosting.secureserver.net,smtpout.secureserver.net:[port], etc.), usernames, passwords,etc. I called goDaddy. Another 40 minutes later, it was revealed that:

1) the "workspace" email accounts are being retired. That's important because if you have an email account with goDaddy today, you likely have a Workspace account. This is, according to the tech support rep, hosted separately from you linux account.

2) goDaddy is moving toward cPanel email accounts. Hurray! Time table? "...in the next 2 to 3 years!"

3) I moved our accounts from Workspace to cPanel accounts while I was on the phone with the rep. Really easy to do.

4) After you change your email accounts (including editing your MX records) to a cPanel email (vs. a "workspace" email) the appropriate settings for a web-form email using PHPMailer are:

SMTP_SERVER: localhost   //(and I mean literally: "localhost"- in place of smtp.secureserver.net and relay-hosting.secureserver.net, etc.)

... and everything else (as above) the same...

The webform I built with PHPMailer worked perfectly after this change!

Use your cPaneL email account login (username) and password in the PHPMailer setup and your web emails will work seamlessly!

An added bonus is that webmail (does anybody use this anymore?) can be accessed at [yourdoman]\webmail. No more cryptic url's to remember! And the accounts cand be IMAP or POP!

Admittedly, this means you must use goDaddy's cPanel email accounts, but getting the webform to work flawslessly with PHPMailer was the real reward!

Hurling answered 10/8, 2014 at 5:53 Comment(6)
Yes! This worked for me. Thank you! OP, please select this as the correct answer. No need to change from linux hosting.Heterosporous
This is one of the most important answers on SO. For email accounts made under the new GoDaddy CPanel: $mail->Host = "localhost"; That's huge!Brubeck
Per suggestions, I'm marking this as the correct answer to direct others to this post. However, I need to state that I have no way of personally verifying this this indeed works since I switched off of my linux server. Since others have had so much success with it, I'm deferring to their judgment. Seems appropriate.Broody
My contact form didn't work for over a year. Every attempt of getting it to work with GoDaddy, G Suite, and WordPress was a deadend... until this one. Thanks!Nipping
Thank you for this! Why the hell isn't this documented or at the very least relayed to their support staff? So frustrating, but thank you for the solution!Rai
I remember up voting this answer after getting my emails to work. but gone are those days too. This time the issue was with PhpMailer class. I updated it to 6.0.7 . and in it, there is this option $SMTPAutoTLS. and this defaults to TRUE. What this does (as per documentation) is, "Whether to enable TLS encryption automatically if a server supports it, even if SMTPSecure is not set to 'tls'." The godaddy support, as usual is ignorant of this update, and they will still do a demo of their "Test Script", by running it in our server, and prove to us that SMTP works just fine.Cady
I
7

After a lot of frustration, this also worked for me.

include("includes/class.phpmailer.php");

date_default_timezone_set('UTC');

define('SMTP_HOST','relay-hosting.secureserver.net');
define('SMTP_PORT',25);**
define('SMTP_USERNAME','[email protected]');
define('SMTP_PASSWORD','me123');
define('SMTP_AUTH',false);

$email = '[email protected]';
$firstName = 'Aravind';

$mail = new PHPMailerR();
$mail->IsSMTP();
$mail->SMTPDebug = 1;                 
$mail->SMTPAuth = SMTP_AUTH;                
$mail->Host = SMTP_HOST;
$mail->Port = 25;
$mail->Username = SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->SetFrom(SMTP_USERNAME,'AravindNC.IN');
$mail->AddReplyTo(SMTP_USERNAME,"AravindNC.IN");
$mail->Subject = "Welcome to AravindNC.IN";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML('This is a test.');
$mail->AddAddress($email, 'Aravind NC');
$mail->Send();

?>
Invasive answered 2/7, 2015 at 22:24 Comment(1)
this worked, thanks! I'll just add that this will only work using it in the godaddy's host, not on your localhost.Muscovite
S
5

these will be your SMTP settings for GoDaddy:

require("PHPMailer-master/PHPMailerAutoload.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug  = 2;
$mail->From = "[email protected]";
$mail->FromName = "name";
$mail->Host = "localhost"; 
$mail->SMTPAuth = false; 
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
Stylistic answered 13/7, 2017 at 17:36 Comment(3)
this worked for me. I used an email account created in the Email Accounts section in CPanel.Amply
@Stylistic where this should go? in .env or mail.php?Geezer
@YousefAltaf in mail.php i think.Stylistic
K
4

I have been experiencing this problem for many weeks. Finally, got it resolved. First, I'd to state the causes of problem (as I experienced it). GoDaddy allows only port 25, 465, 80 to get out. So, you cannot reach any SMTP server that are not using any of those 3 ports. But if you are using SMTP from GMAIL per example, or any other replay server (especially from Bell Canada, on port 465), then any relay request from GoDaddy will be blocked - hence you will see the Connection Refused (111). Yes, they are competitors in hosting services... so draw your own conclusion on when this problem will get solved between them. Worse, when you send an email from relay-hosting.secureserver.net provided by GoDaddy, you are facing a major inconvenience of long queuing that could take a couple of minutes to get the email out. Worse yet, people with Bell Canada (or Bell affiliates') email account will not see email from this relay server - the email does not even get to your spam box! As the email is completely blocked by Bell (their excuse = too much spams from GoDaddy).

So, recently I did this and it worked fine for me. If you have a hosting service with GoDaddy, then register an email account. Then using that email account, example [email protected], do this with PHPMail:

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtpout.secureserver.net";
$mail->Username = "[email protected]"; /*Substitute with your real email*/
$mail->Password = "myverylongpassword"; /*Substitute with your real password*/
$mail->SMTPAuth = true;
$mail->Port = 80;

Then do your regular PHPMailing things... This works great for me. I hope it does the same for you.

Kellsie answered 31/3, 2015 at 19:27 Comment(3)
Godaddy support is clueless.. I didn't know about using port 80 - this totally worked for me on the classic linux hostingAttribution
thanks.. it worked for me.. I was banging my head for 2 days.. thanks againCartwright
what the hell is that! I mean I have wasted my 2 days and also setup g-suite to get rid with 2-step verification error and than I have tried your solution and its worked. THANKS BRO . . .Arroba
U
4

Earlier to make it work, the GoDaddy SMTP host was:

$mail->Host = 'smtpout.secureserver.net';

Then GoDaddy SMTP host was changed to:

$mail->Host = 'relay-hosting.secureserver.net';

But Now GoDaddy SMTP host which works properly is:

$mail->Host = 'localhost';

Also you can keep “SMTPAuth = false” and “Username/Password = Blank”. It doesn’t matters if you are using a GoDaddy Hosting Email or GoDaddy cPanel Email.

The main line of code is, so please make sure you include it:

$mail->SMTPAutoTLS = false; 

You can copy whole of below code, it will work exactly as it is:

if(isset($_POST["submit"])){

include('phpmailer/PHPMailerAutoload.php');
                    
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail->SMTPDebug = 0;  // Enable verbose debug output

//SMTP settings start
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'localhost'; // Specify main and backup SMTP servers
$mail->SMTPAuth = false; // Enable SMTP authentication
$mail->Username = ''; // SMTP username
$mail->Password = ''; // SMTP password
$mail->SMTPAutoTLS = false; 
$mail->SMTPSecure = false; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25;

//Sender
$mail->setFrom('[email protected]');
//Receiver
$mail->addAddress('[email protected]');

//Email Subject & Body
$mail->Subject = 'New Form Submission';
//Form Fields
$mail->Body = '
                Name = '$name'
                Email = '$email'
                Subject = '$subject'
                Message = '$message'
';

$mail->isHTML(true); // Set email format to HTML

//Send the message, check for errors
if (!$mail->send()) {
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else {
     echo 'Form Submitted Successfully.';
     // code for saving in data in database can be added here
}
Unrobe answered 2/3, 2022 at 8:58 Comment(0)
F
3

After wrestling with this issue for a couple days and getting it to work I thought I would update this thread for 2017. Hopefully I can save someone a few wasted hours. I am hosted on Godaddy with cpanel. It was the SMTPAutoTLS setting I finally ran across and tried that was the missing piece. The error I was receiving is as follows:

PHP Warning: stream_socket_enable_crypto(): Peer certificate CN=*.prod.iad2.secureserver.net' did not match expected CN=localhost' in /home/username/public_html/classes/PHPMailer/class.smtp.php on line 369

Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

The following are the PHPMailer settings that worked for me.

$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
$mail->SMTPAuth = false;  
Fossilize answered 24/3, 2017 at 1:54 Comment(0)
G
2

I have same problem But I tried this

$mail->SMTPAuth = false;

and HOSTNAME: relay-hosting.secureserver.net

And Bingoooooo its working

please just do once this setting in SMTP

Griseldagriseldis answered 21/11, 2014 at 10:49 Comment(0)
W
2

According to Godaddy, replace

$mail->Host = "smtpout.secureserver.net"; //also tried "relay-hosting.secureserver.net"

with

$mail->Host = "smtp.secureserver.net"; //also tried "relay-hosting.secureserver.net"

It worked for me.

Wry answered 13/5, 2015 at 15:42 Comment(2)
lots of extra stuff I DIDN'T type.Wry
still SMTP.connect() FailedRaid
I
2

GoDaddy/Linux (cPanel)/PHPMailer

require_once("../include/PHPMailer-master/PHPMailerAutoload.php");

$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host         = "a2plcpnXXXXX.prod.iad2.secureserver.net";
$mail->SMTPDebug    = 2; 
$mail->SMTPAuth     = true;
$mail->Username     = "your username";
$mail->Password     = "your password";
$mail->SMTPSecure   = "tls";
$mail->Port         = 587;

Feel free to use whatever email/name you want for the $mail->From and $mail->FromName values. Hope this helps.

Indiaindiaman answered 25/7, 2015 at 9:29 Comment(0)
S
2

Using some of the advice above I was able to get a turnkey bootstrap site up and running with email on shared hosting on GoDaddy.

I made an AJAX call to email.php which contained:

 <?php

require 'PHPMailerAutoload.php';

if ($_POST) {
    $name    = $_POST['contactName'];
    $email   = $_POST['contactEmail'];
    $message = $_POST['contactMessage'];

    /* Don't touch */
    $mail = new PHPMailer();
    $mail->isSMTP();
    $mail->Host        = "relay-hosting.secureserver.net";
    $mail->SMTPAuth    = false;
    $mail->setFrom($email, $name);
    /* end */

    /* Configure the address the email will be sent to */
    $mail->addAddress('[email protected]', 'Adam InTae Gerard');
    $mail->Subject = 'Re: StackChampion Inquest';
    /* This is forwarded through a GoDaddy forwarding account */

    $mail->Body    = $message;

    if (!$mail->send()) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    } else {
        echo "Message sent!";
    }
}
?> 

I put together a working demo on GitHub available here:

https://github.com/Thoughtscript/wp_postlib_godaddy_php_emailer

That's free to use and opensource but the relevant code is listed above. There are apparently a lot of problems with their SMTP servers - I've found that you can bypass that by using their offered relay servers which don't require authentication though they can still be associated with one of your registered emails acounts.

Hope that helps somebody! Cheers!

Sciamachy answered 13/1, 2016 at 4:9 Comment(0)
B
1

Well, I got this resolved, but not in a good way. After exhausting everything I could think of, I just threw my hands up and told GoDaddy to switch me back to the Windows server. As soon as they did that, the problem disappeared. Since I don't really care what type of server I'm on, this result is satisfactory, but hardly satisfying.

So, my advice for any GoDaddy customers who believe that they have PHPMailer set up correctly but can't make it work is to find out if you are on a Linux server. It looks to me like GoDaddy has their Linux servers set up to block this type of mail transaction. I can't say that definitively, since I only believe that because I failed at making it work. But I can clearly say that my PHPMailer setup was accurate, at least with Windows.

Maybe this will help save someone some time and frustration. If anyone has a better idea, please post.

Broody answered 18/2, 2014 at 23:6 Comment(4)
I had the same issue and once I removed everything (username, pw, port, etc) but the host, I got it working. I have shared hosting on GoDaddy, linux.Masse
@Alex, I do think you should consider changing your accepted answer to globalSchmidt's above. Only you can do that. I'm guessing you'd take a small ding on reputation but your motivation was always to get the right answer out there to save folks time. His experience and write-up definitely meet your original invitation to 'please post' a better idea.Pelagic
@agunn OK. Done. See my comment.Broody
@Alex, Thank you. And your comment is most appropriate.Pelagic
R
1

Change this:

$mail->Host = 'smtpout.secureserver.net:465';
$mail->SMTPSecure = "ssl";

To this:

$mail->Host = 'smtpout.secureserver.net:25';

and it worked for me!

Ravelin answered 26/6, 2014 at 19:53 Comment(1)
OP's edit says that he already tried using this port. Please read the original post.Sihunn
B
1

if on your hosting have a own email server, your email server using the following ports 25,465,587. Settings for GoDaddy:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'password';

//$mail->SMTPSecure = 'tls'; 
//$mail->Port = 587;

On the other servers need to create a mailbox with your domain:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'password';

//$mail->SMTPSecure = 'tls'; 
//$mail->Port = 587;
Budgerigar answered 21/9, 2014 at 8:56 Comment(0)
A
1

Update for Jan 2015: I just had to solve this exact problem. You need to have GoDaddy linux hosting with cPanel email accounts:

  1. In the email accounts section, next to each email address in a dropdown, click the option to 'configure email client'.
  2. On the next page, scroll down to 'Manual Settings'. Here you'll see that GoDaddy now creates a bespoke incoming/outgoing servers for each email address. So use the outgoing server, SSL, auth:true, port:465, email/password.

Hope that helps.

Albumose answered 28/1, 2015 at 14:13 Comment(0)
Q
1

If using cPanel and WPForms in WordPress

What helped me is to create email address from cPanel and use its settings from Manual Settings section either with SSL or Non SSL

enter image description here

Quantify answered 20/12, 2017 at 3:5 Comment(0)
R
1

Godaddy is s nightmare.

If you are using an older work space email account and are unfamiliar with cpanel try this

require '/home/content/94/8357694/html/SHTECH/server/PHPMailer.php';
use PHPMailer\PHPMailer\PHPMailer;

function sendmail($to,$subject,$message,$name)
{

define('SMTP_HOST','relay-hosting.secureserver.net');
define('SMTP_PORT',25);
define('SMTP_AUTH',true);



              $mail             = new PHPMailer();

              $mail->IsSMTP();
              $mail -> SMTPDebug = 1;
              $mail->Host       = "smtpout.secureserver.net";
              $mail->SMTPAuth   = SMTP_AUTH;
              $mail->Port       = 80;
              $mail->Username   = "[email protected]";
              $mail->Password   = "allen1";
              //$mail->SMTPSecure = 'ssl';
              $mail->SetFrom('[email protected]', 'Cagney');
              $mail->AddReplyTo("[email protected]","Cagney");
              $mail->Subject    = $subject;
              $body             = $message;
              $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
              $mail->MsgHTML($body);
              $address = $to;
              $mail->AddAddress($address, $name);
              if(!$mail->Send()) {
                  return 0;
              } else {
                    return 1;
              }




}
Rejoin answered 13/8, 2018 at 19:15 Comment(0)
S
0

Just had this problem, contacted GoDaddy and they switched my MX over from Local to Remote and it solved the problem instantly! Just a heads up for anyone that is still experiencing this issue.

Sensibility answered 8/5, 2016 at 1:4 Comment(0)
A
0

Updated 8-25-2019 For those seeking an answer to the proper way to set up Rd-Mailform and PHPmailer for Godaddy.

First off make sure that you have the latest files from Github.

Second here are the CORRECT settings for the Cpanel Email with SMTP and GODaddy

Edit the following file: rd-mailform.config.json (if your not using this file, then hard code in rd-mailform.php)

File to edit is:rd-mailform.config.json

~~~
 "useSmtp": false,
 "host": "localhost",              
 "port": 25,                                                     
 "username": "[email protected]",                   
 "password": "yourpasswordforthataccount",                       
 "recipientEmail":  "youremailaddress"  
~~~ 

Now after you have that edit open rd-mailform.php and edit the folling lines to be as follows: // Whether to use SMTP authentication

            $mail->SMTPAuth = false;
            $mail->SMTPAutoTLS = false; 
            $mail->SMTPSecure = "tls";

That should work for all Godaddy servers using rd-mailform with phpmailer

-D

Audwin answered 25/8, 2019 at 14:33 Comment(0)
G
0

After hours of dirty work I realized that with go daddy, the configure mail client host details given for both SSL and TLS do not work. For this reason you have to copy part of the Cpanel url as your host.

**NB:**Make sure the url is what is resolved after typing your server ip and port on the search bar e.g 0:0:0:0:2083

The configuration should look something like

$smtp = Mail::factory('smtp', array (
'host' =>'2ueywefewueyuyeyryruw.prod.xxx.secureserver.net',
'port' => '587', 'auth' => true, 'username' => "youremail",
'password' => "yourEmailPassword", 'secure' => 'ssl'));

you can also refer to this link here

Greysun answered 24/3, 2021 at 14:54 Comment(0)
H
-3

GoDaddy Server SMTP Connection Refused.

Bigrock $mail->Port =587;// SMTP ser*vers

GoDaddy $mail->Port =25;// SMTP ser*vers

Hypersonic answered 23/10, 2015 at 8:11 Comment(1)
This is not an answer to the question - it is a very low-quality description of your issue. Consider revising your answer or ask a proper question.Stratocumulus

© 2022 - 2024 — McMap. All rights reserved.