PHPMailer GoDaddy 服务器 SMTP 连接被拒绝 [英] PHPMailer GoDaddy Server SMTP Connection Refused

查看:33
本文介绍了PHPMailer GoDaddy 服务器 SMTP 连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前几天,我的 GoDaddy 托管网站遇到了一些问题.我打电话给他们的技术支持,我与之交谈的那个人建议我的问题与我使用的是 Windows 机器的事实有关,并且在 Linux 机器上会得到更好的服务.对此没有意见,我同意了,他们把我换了.

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.

在那个转变之后,我的 PHPMailer 功能已经抛弃了我.我已经工作了几个月,所以我知道我的设置是准确的.我已与 GoDaddy 确认,从他们的角度来看,我尝试发送出去的帐户没有改变.用户端没有进行任何更改(如新密码).最重要的是,唯一不同的是我的网站现在托管在 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 困难一定与此有关,因为一个运行了数月的脚本在服务器转换发生的那一刻失败实在是太巧合了.但为什么?我在他们的技术支持处花了一个小时,他们认为服务器设置没有任何问题.我们验证了我的设置(只是为了好玩).一切看起来都不错,但是当我发送电子邮件时,出现此错误:

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 ->错误:无法连接到服务器:连接被拒绝 (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;

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

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!

我还应该提到我所做的其他一些尝试.无论如何,我得到相同的结果.

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

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

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.

推荐答案

由于这似乎是一个持续存在的问题,让我补充一下我自己的经验.

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

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

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

在尝试了各种不同的端口(25、3535、4655)、服务器relay-hosting.secureserver.net、smtpout.secureserver.net:[port] 等)、用户名、密码等 6 个多小时后.我打电话给 goDaddy.又过了 40 分钟,才发现:

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) 工作区"电子邮件帐户正在停用.这很重要,因为如果您今天拥有 goDaddy 的电子邮件帐户,则您可能拥有一个 Workspace 帐户.根据技术支持代表的说法,这是与您的 linux 帐户分开托管的.

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 正在转向 cPanel 电子邮件帐户.欢呼!时间表?……在接下来的 2 到 3 年内!"

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

3) 当我与代表通电话时,我将我们的帐户从 Workspace 转移到了 cPanel 帐户.真的很容易做到.

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

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

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

我使用 PHPMailer 构建的网络表单在此更改后运行良好!

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

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

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

一个额外的好处是可以在 [yourdoman]webmail 访问 webmail(还有人使用它吗?).不再需要记住神秘的网址!帐户可以是 IMAP 或 POP!

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!

诚然,这意味着您必须使用 goDaddy 的 cPanel 电子邮件帐户,但让网络表单与 PHPMailer 完美配合才是真正的奖励!

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

这篇关于PHPMailer GoDaddy 服务器 SMTP 连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆