PHPMailer GoDaddy服务器SMTP拒绝连接

时间:2021-07-14 18:11:22

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.

前几天,我在GoDaddy网站上遇到了一些问题。我打电话给他们的技术支持部门,与我交谈的人说,我的问题与我在Windows操作系统上有关,在Linux操作系统上更好。我没有意见,我同意了,他们把我调职了。

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.

在这个转变之后,我的PHPMailer功能已经抛弃了我。我已经用了几个月了,所以我知道我的设置是准确的。我已经和GoDaddy确认过,我要发送出去的账号从他们的角度来看没有改变。用户端没有做任何更改(比如新的密码)。总之,唯一不同的是,我的站点现在托管在Linux服务器上。就是这样。

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:

因此,我假设PHPMailer遇到的困难一定与此有关,因为一个工作了几个月的脚本恰好在服务器转换发生的那一刻失败,这实在是太巧合了。但是为什么呢?我花了一个小时与他们的技术支持,他们认为服务器设置没有问题。我们验证了我的设置(只是为了好玩)。一切看起来都很好,但是当我发邮件的时候,我就会犯这样的错误:

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

SMTP ->错误:连接失败:连接拒绝(111)SMTP connect()失败。

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     = "example@email.com";
$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.

有人知道为什么会这样吗?是否存在一些技术支持人员可能没有意识到的服务器设置,比如在我的php中。ini文件?和我一起工作的那个人尽了最大的努力来帮助我,但他可能只是没有意识到一些事情。

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.

1)带端口587的TLS 2)没有使用端口25、80和3535的SSL。2)我自己的gmail地址修改服务器、用户名、密码等。

17 个解决方案

#1


29  

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:

我们的网站使用PHPMailer,网站托管在GoDaddy linux服务器上。这些设置似乎是正确的(根据我在SO和goDaddy支持网站上找到的所有内容)如下:

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:

在花了6个多小时尝试各种端口(25,3535,4655)之后,服务器中继主机。secureserver.net,smtpout.secureserver.net:[端口]等),用户名,密码等等。我叫goDaddy。又过了40分钟,发现:

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.

1)“工作空间”的电子邮件帐户正在退役。这很重要,因为如果你现在有一个goDaddy的电子邮件账户,你很可能有一个工作空间账户。根据技术支持代表的说法,这是独立于您的linux帐户托管的。

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

2) goDaddy正在转向cPanel的电子邮件账户。华友世纪!时间表吗?“…在未来2到3年内!

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

3)我把我们的账户从工作空间转移到cPanel账户,而我和代表通电话的时候真的很容易。

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:

4)当您将您的电子邮件帐户(包括编辑您的MX记录)更改为cPanel电子邮件(与“工作区”电子邮件)后,使用PHPMailer的web表单电子邮件的适当设置是:

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!

我用PHPMailer构建的webform在这次更改之后运行得非常好!

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

在PHPMailer设置中使用cPaneL电子邮件帐户登录(用户名)和密码,您的电子邮件将无缝工作!

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!

还有一个额外的好处是,webmail(有人使用它吗?)可以在[yourdoman]\webmail中访问。没有更神秘的url要记住!还有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!

诚然,这意味着你必须使用goDaddy的cPanel电子邮件账户,但让这个webform在PHPMailer上正常运行才是真正的回报!

#2


36  

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

我使用的是GoDaddy Linux,比如@surfbird0713。在我的第32次尝试中,以下方法对我同样有效:

$mail2->Host = localhost;
//$mail2->SMTPAuth = false;
//$mail2->Username = 'xxxx@xxxxxx.com';
//$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.

我之前尝试过用户名、登录名、端口等。当我注释掉所有这些时,我只使用localhost。

#3


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).

我已经经历这个问题好几个星期了。最后,把它解决了。首先,我要说明问题的原因(正如我所经历的)。GoDaddy只允许端口25,46,80离开。因此,您无法访问任何没有使用这3个端口中的任何一个的SMTP服务器。但是,如果您使用的是GMAIL的SMTP,或者任何其他的重播服务器(特别是来自于端口465上的Bell Canada),那么GoDaddy的任何中继请求都将被阻塞——因此您将看到连接被拒绝(111)。是的,他们是托管服务的竞争者……所以,你可以自己得出结论,这个问题什么时候才能解决。更糟糕的是,当你从GoDaddy提供的relhost .secureserver.net上发送电子邮件时,你正面临着长时间排队的巨大不便,可能要花几分钟才能把邮件发出去。更糟糕的是,拥有加拿大贝尔(或贝尔附属公司)电子邮件帐户的人不会看到来自这个中继服务器的电子邮件——电子邮件甚至不会到达您的垃圾邮件箱!因为邮件完全被贝尔屏蔽了(他们的借口= 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 mywebmail@mydomain.com, do this with PHPMail:

所以,最近我做了这个,它对我很有效。如果你有一个托管服务与GoDaddy,然后注册一个电子邮件帐户。然后使用这个电子邮件帐户,例如mywebmail@mydomain.com,使用PHPMail:

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtpout.secureserver.net";
$mail->Username = "mywebmail@mydomain.com"; /*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.

然后做一些常规的电话留言……这对我很有用。我希望对你也一样。

#4


3  

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','me@aravindnc.com');
define('SMTP_PASSWORD','me123');
define('SMTP_AUTH',false);

$email = 'aravind_n_c@yahoo.co.in';
$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();

?>

#5


2  

I have same problem But I tried this

我也有同样的问题,但我试过了

$mail->SMTPAuth = false;

and HOSTNAME: relay-hosting.secureserver.net

主机名:relay-hosting.secureserver.net

And Bingoooooo its working

和Bingoooooo其工作

please just do once this setting in SMTP

请在SMTP中执行此设置一次

#6


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.

使用上面的一些建议,我能够获得一个钥匙引导站点,并运行电子邮件在GoDaddy共享主机上。

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

我给电子邮件做了一个AJAX调用。php包含:

 <?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('administrator@stackchampion.com', '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:

我在GitHub上做了一个工作演示:

https://github.com/Thoughtscript/wp_postlib_godaddy_php_emailer

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.

这是免费使用和开放源代码,但相关代码列在上面。显然,他们的SMTP服务器有很多问题——我发现,通过使用他们提供的不需要身份验证的中继服务器,可以绕过这个问题,尽管它们仍然可以与您的一个注册电子邮件关联。

Hope that helps somebody! Cheers!

希望帮助别人!干杯!

#7


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.

我解决了这个问题,但不是很好。在用尽了我能想到的一切之后,我只是举起双手,告诉GoDaddy把我转回Windows服务器。他们一这么做,问题就消失了。由于我并不真正关心我所使用的服务器类型,所以这个结果是令人满意的,但是很难令人满意。

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.

因此,对于那些认为PHPMailer设置正确但不能正常工作的GoDaddy客户,我的建议是,看看您是否在Linux服务器上。在我看来,GoDaddy已经设置了Linux服务器来阻止这种类型的邮件事务。我不能肯定地说,因为我只是相信,因为我没能让它发挥作用。但我可以明确地说,我的PHPMailer设置是准确的,至少在Windows上是如此。

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

也许这能帮助某人节省一些时间和挫折。如果有人有更好的主意,请贴出来。

#8


1  

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

如果您的主机上有一个自己的电子邮件服务器,您的电子邮件服务器使用以下端口25465587。GoDaddy的设置:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = 'example@gmail.com';
$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 = 'example@yourdomain.com';
$mail->Password = 'password';

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

#9


1  

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

2015年1月更新:我刚刚解决了这个问题。您需要有GoDaddy linux主机与cPanel电子邮件帐户:

  1. In the email accounts section, next to each email address in a dropdown, click the option to 'configure email client'.
  2. 在电子邮件帐户部分,在下拉菜单中,在每个电子邮件地址旁边,单击“配置电子邮件客户端”选项。
  3. 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.
  4. 在下一页,向下滚动到“手动设置”。在这里,您将看到GoDaddy现在为每个电子邮件地址创建了一个定制的传入/传出服务器。因此,使用传出服务器,SSL, auth:true,端口:465,电子邮件/密码。

Hope that helps.

希望有帮助。

#10


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!

这对我很有效!

#11


1  

According to Godaddy, replace

根据Godaddy,替换

$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.

它为我工作。

#12


1  

If using cPanel and WPForms in WordPress

如果在WordPress中使用cPanel和WPForms

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

帮助我创建电子邮件地址从cPanel和使用它的设置从手动设置部分,无论是与SSL或非SSL

PHPMailer GoDaddy服务器SMTP拒绝连接

#13


0  

GoDaddy/Linux (cPanel)/PHPMailer

GoDaddy / Linux / PHPMailer(cPanel)

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.

您可以使用任何您想要的电子邮件/名称->和$mail->名称值。希望这个有帮助。

#14


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.

刚刚有了这个问题,他们联系了GoDaddy,他们把我的MX从本地切换到远程,这立即解决了问题!只要提醒那些还在经历这个问题的人。

#15


0  

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:

在花了几天时间思考这个问题并将其付诸实践之后,我想我会在2017年更新这个帖子。希望我能帮别人节省几个小时。我在Godaddy上主持cpanel。是smtpautols的设置,我终于遇到并尝试,那是缺失的部分。我收到的错误如下:

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

PHP警告:stream_socket_enable_crypto():对等证书CN=*.prod.iad2.secureserver.net'没有与/home/username/public_html/class /PHPMailer/class.smtp中的预期CN=localhost'匹配。php在第369行

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

邮件发送错误:SMTP connect()失败。https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

The following are the PHPMailer settings that worked for me.

下面是对我有用的PHPMailer设置。

$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
$mail->SMTPAuth = false;  

#16


0  

these will be your SMTP settings for GoDaddy:

这些将是您的SMTP设置为GoDaddy:

require("PHPMailer-master/PHPMailerAutoload.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug  = 2;
$mail->From = "yourmail@ddd.com";
$mail->FromName = "name";
$mail->Host = "localhost"; 
$mail->SMTPAuth = false; 
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;

#17


-2  

GoDaddy Server SMTP Connection Refused.

GoDaddy服务器SMTP连接拒绝。

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

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

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

GoDaddy $mail->端口=25;// SMTP ser*vers。

#1


29  

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:

我们的网站使用PHPMailer,网站托管在GoDaddy linux服务器上。这些设置似乎是正确的(根据我在SO和goDaddy支持网站上找到的所有内容)如下:

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:

在花了6个多小时尝试各种端口(25,3535,4655)之后,服务器中继主机。secureserver.net,smtpout.secureserver.net:[端口]等),用户名,密码等等。我叫goDaddy。又过了40分钟,发现:

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.

1)“工作空间”的电子邮件帐户正在退役。这很重要,因为如果你现在有一个goDaddy的电子邮件账户,你很可能有一个工作空间账户。根据技术支持代表的说法,这是独立于您的linux帐户托管的。

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

2) goDaddy正在转向cPanel的电子邮件账户。华友世纪!时间表吗?“…在未来2到3年内!

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

3)我把我们的账户从工作空间转移到cPanel账户,而我和代表通电话的时候真的很容易。

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:

4)当您将您的电子邮件帐户(包括编辑您的MX记录)更改为cPanel电子邮件(与“工作区”电子邮件)后,使用PHPMailer的web表单电子邮件的适当设置是:

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!

我用PHPMailer构建的webform在这次更改之后运行得非常好!

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

在PHPMailer设置中使用cPaneL电子邮件帐户登录(用户名)和密码,您的电子邮件将无缝工作!

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!

还有一个额外的好处是,webmail(有人使用它吗?)可以在[yourdoman]\webmail中访问。没有更神秘的url要记住!还有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!

诚然,这意味着你必须使用goDaddy的cPanel电子邮件账户,但让这个webform在PHPMailer上正常运行才是真正的回报!

#2


36  

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

我使用的是GoDaddy Linux,比如@surfbird0713。在我的第32次尝试中,以下方法对我同样有效:

$mail2->Host = localhost;
//$mail2->SMTPAuth = false;
//$mail2->Username = 'xxxx@xxxxxx.com';
//$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.

我之前尝试过用户名、登录名、端口等。当我注释掉所有这些时,我只使用localhost。

#3


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).

我已经经历这个问题好几个星期了。最后,把它解决了。首先,我要说明问题的原因(正如我所经历的)。GoDaddy只允许端口25,46,80离开。因此,您无法访问任何没有使用这3个端口中的任何一个的SMTP服务器。但是,如果您使用的是GMAIL的SMTP,或者任何其他的重播服务器(特别是来自于端口465上的Bell Canada),那么GoDaddy的任何中继请求都将被阻塞——因此您将看到连接被拒绝(111)。是的,他们是托管服务的竞争者……所以,你可以自己得出结论,这个问题什么时候才能解决。更糟糕的是,当你从GoDaddy提供的relhost .secureserver.net上发送电子邮件时,你正面临着长时间排队的巨大不便,可能要花几分钟才能把邮件发出去。更糟糕的是,拥有加拿大贝尔(或贝尔附属公司)电子邮件帐户的人不会看到来自这个中继服务器的电子邮件——电子邮件甚至不会到达您的垃圾邮件箱!因为邮件完全被贝尔屏蔽了(他们的借口= 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 mywebmail@mydomain.com, do this with PHPMail:

所以,最近我做了这个,它对我很有效。如果你有一个托管服务与GoDaddy,然后注册一个电子邮件帐户。然后使用这个电子邮件帐户,例如mywebmail@mydomain.com,使用PHPMail:

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtpout.secureserver.net";
$mail->Username = "mywebmail@mydomain.com"; /*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.

然后做一些常规的电话留言……这对我很有用。我希望对你也一样。

#4


3  

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','me@aravindnc.com');
define('SMTP_PASSWORD','me123');
define('SMTP_AUTH',false);

$email = 'aravind_n_c@yahoo.co.in';
$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();

?>

#5


2  

I have same problem But I tried this

我也有同样的问题,但我试过了

$mail->SMTPAuth = false;

and HOSTNAME: relay-hosting.secureserver.net

主机名:relay-hosting.secureserver.net

And Bingoooooo its working

和Bingoooooo其工作

please just do once this setting in SMTP

请在SMTP中执行此设置一次

#6


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.

使用上面的一些建议,我能够获得一个钥匙引导站点,并运行电子邮件在GoDaddy共享主机上。

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

我给电子邮件做了一个AJAX调用。php包含:

 <?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('administrator@stackchampion.com', '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:

我在GitHub上做了一个工作演示:

https://github.com/Thoughtscript/wp_postlib_godaddy_php_emailer

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.

这是免费使用和开放源代码,但相关代码列在上面。显然,他们的SMTP服务器有很多问题——我发现,通过使用他们提供的不需要身份验证的中继服务器,可以绕过这个问题,尽管它们仍然可以与您的一个注册电子邮件关联。

Hope that helps somebody! Cheers!

希望帮助别人!干杯!

#7


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.

我解决了这个问题,但不是很好。在用尽了我能想到的一切之后,我只是举起双手,告诉GoDaddy把我转回Windows服务器。他们一这么做,问题就消失了。由于我并不真正关心我所使用的服务器类型,所以这个结果是令人满意的,但是很难令人满意。

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.

因此,对于那些认为PHPMailer设置正确但不能正常工作的GoDaddy客户,我的建议是,看看您是否在Linux服务器上。在我看来,GoDaddy已经设置了Linux服务器来阻止这种类型的邮件事务。我不能肯定地说,因为我只是相信,因为我没能让它发挥作用。但我可以明确地说,我的PHPMailer设置是准确的,至少在Windows上是如此。

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

也许这能帮助某人节省一些时间和挫折。如果有人有更好的主意,请贴出来。

#8


1  

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

如果您的主机上有一个自己的电子邮件服务器,您的电子邮件服务器使用以下端口25465587。GoDaddy的设置:

$mail->isSMTP(); 
$mail->Host = localhost; 
$mail->SMTPAuth = true;
$mail->Username = 'example@gmail.com';
$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 = 'example@yourdomain.com';
$mail->Password = 'password';

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

#9


1  

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

2015年1月更新:我刚刚解决了这个问题。您需要有GoDaddy linux主机与cPanel电子邮件帐户:

  1. In the email accounts section, next to each email address in a dropdown, click the option to 'configure email client'.
  2. 在电子邮件帐户部分,在下拉菜单中,在每个电子邮件地址旁边,单击“配置电子邮件客户端”选项。
  3. 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.
  4. 在下一页,向下滚动到“手动设置”。在这里,您将看到GoDaddy现在为每个电子邮件地址创建了一个定制的传入/传出服务器。因此,使用传出服务器,SSL, auth:true,端口:465,电子邮件/密码。

Hope that helps.

希望有帮助。

#10


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!

这对我很有效!

#11


1  

According to Godaddy, replace

根据Godaddy,替换

$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.

它为我工作。

#12


1  

If using cPanel and WPForms in WordPress

如果在WordPress中使用cPanel和WPForms

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

帮助我创建电子邮件地址从cPanel和使用它的设置从手动设置部分,无论是与SSL或非SSL

PHPMailer GoDaddy服务器SMTP拒绝连接

#13


0  

GoDaddy/Linux (cPanel)/PHPMailer

GoDaddy / Linux / PHPMailer(cPanel)

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.

您可以使用任何您想要的电子邮件/名称->和$mail->名称值。希望这个有帮助。

#14


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.

刚刚有了这个问题,他们联系了GoDaddy,他们把我的MX从本地切换到远程,这立即解决了问题!只要提醒那些还在经历这个问题的人。

#15


0  

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:

在花了几天时间思考这个问题并将其付诸实践之后,我想我会在2017年更新这个帖子。希望我能帮别人节省几个小时。我在Godaddy上主持cpanel。是smtpautols的设置,我终于遇到并尝试,那是缺失的部分。我收到的错误如下:

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

PHP警告:stream_socket_enable_crypto():对等证书CN=*.prod.iad2.secureserver.net'没有与/home/username/public_html/class /PHPMailer/class.smtp中的预期CN=localhost'匹配。php在第369行

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

邮件发送错误:SMTP connect()失败。https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

The following are the PHPMailer settings that worked for me.

下面是对我有用的PHPMailer设置。

$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
$mail->SMTPAuth = false;  

#16


0  

these will be your SMTP settings for GoDaddy:

这些将是您的SMTP设置为GoDaddy:

require("PHPMailer-master/PHPMailerAutoload.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug  = 2;
$mail->From = "yourmail@ddd.com";
$mail->FromName = "name";
$mail->Host = "localhost"; 
$mail->SMTPAuth = false; 
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;

#17


-2  

GoDaddy Server SMTP Connection Refused.

GoDaddy服务器SMTP连接拒绝。

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

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

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

GoDaddy $mail->端口=25;// SMTP ser*vers。