简体   繁体   English

PHPMailer GoDaddy 服务器 SMTP 连接被拒绝

[英]PHPMailer GoDaddy Server SMTP Connection Refused

The other day I was experiencing some problems with my GoDaddy hosted site.前几天,我在使用 GoDaddy 托管网站时遇到了一些问题。 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.我打电话给他们的技术支持,与我交谈的人建议我的问题与我在 Windows 盒子上的事实有关,在 Linux 盒子上会更好。 Having no opinion on this, I agreed and they switched me over.对此没有意见,我同意了,他们把我换了。

In the wake of that transition, my PHPMailer functionality has deserted me.在这种转变之后,我的 PHPMailer 功能已经离我而去。 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.我已与 GoDaddy 确认,从他们的角度来看,我尝试发送的帐户没有改变。 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.最重要的是,唯一不同的是我的网站现在托管在 Linux 服务器上。 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.所以我认为我的 PHPMailer 问题一定与此有关,因为在服务器转换发生的确切时刻,一个已经工作了几个月的脚本失败了,这太巧合了。 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:一切看起来都很好,但是当我发送 email 时,我收到了这个错误:

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     = "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?是否有一些技术支持人员可能不知道的服务器设置,比如在我的 php.ini 文件中? 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. 1) 端口587的TLS 2) 没有SSL使用端口25、80和3535。 2) 我自己的gmail地址修改服务器、用户名、密码等。

I'm on GoDaddy on a Linux like @surfbird0713.我在像@surfbird0713 这样的 Linux 上使用 GoDaddy。 On my 32nd attempt, the following worked for me as well:在我的第 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 就可以了。

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.我们的网站使用 PHPMailer,该网站托管在 GoDaddy linux 服务器上。 The settings that seemed to be correct (according to everything I could find on SO and the goDaddy support site) were as follows:似乎正确的设置(根据我在 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.在花了 6 个多小时尝试了各种端口(25、3535、4655)、服务器relay-hosting.secureserver.net、smtpout.secureserver.net:[port] 等)、用户名、密码等之后。 I called goDaddy.我打电话给goDaddy。 Another 40 minutes later, it was revealed that:又过了40分钟,才发现:

1) the "workspace" email accounts are being retired. 1) “工作区”电子邮件帐户正在停用。 That's important because if you have an email account with goDaddy today, you likely have a Workspace account.这很重要,因为如果您今天拥有 goDaddy 的电子邮件帐户,则您可能拥有一个 Workspace 帐户。 This is, according to the tech support rep, hosted separately from you linux account.根据技术支持代表的说法,这是与您的 linux 帐户分开托管的。

2) goDaddy is moving toward cPanel email accounts. 2) goDaddy 正在转向 cPanel 电子邮件帐户。 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. 3) 我在与代表通电话时将我们的帐户从 Workspace 转移到了 cPanel 帐户。 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: 4) 在您将电子邮件帐户(包括编辑您的 MX 记录)更改为 cPanel 电子邮件(与“工作区”电子邮件)后,使用 PHPMailer 的网络表单电子邮件的适当设置是:

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 构建的网络表单在此更改后完美运行!

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.一个额外的好处是可以在 [yourdoman]\\webmail 访问 webmail(还有人使用它吗?)。 No more cryptic url's to remember!不再需要记住神秘的网址! And the accounts cand be IMAP or POP!帐户可以是 IMAP 或 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 电子邮件帐户,但让网络表单与 PHPMailer 完美配合才是真正的奖励!

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();

?>

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. GoDaddy 只允许端口2546580退出。 So, you cannot reach any SMTP server that are not using any of those 3 ports.因此,您无法访问任何未使用这 3 个端口中的任何一个的 SMTP 服务器。 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) .但是,如果您在每个示例中使用来自 GMAIL 的 SMTP 或任何其他重播服务器(尤其是来自加拿大贝尔的465端口),那么来自 GoDaddy 的任何中继请求都将被阻止 - 因此您将看到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.更糟糕的是,当您从 GoDaddy 提供的relay-hosting.secureserver.net发送电子邮件时,您会面临长时间排队的重大不便,可能需要几分钟才能将电子邮件发送出去。 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!更糟糕的是,拥有 Bell Canada(或 Bell 附属公司)电子邮件帐户的人将看不到来自该中继服务器的电子邮件 - 电子邮件甚至不会到达您的垃圾邮件箱! As the email is completely blocked by Bell (their excuse = too much spams from GoDaddy).由于电子邮件完全被贝尔阻止(他们的借口 = 来自 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.如果您有 GoDaddy 的托管服务,请注册一个电子邮件帐户。 Then using that email account, example mywebmail@mydomain.com , do this with PHPMail:然后使用该电子邮件帐户,例如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.然后做你的常规 PHPMailing 事情......这对我来说很好用。 I hope it does the same for you.我希望它对你也一样。

these will be your SMTP settings for GoDaddy:这些将是 GoDaddy 的 SMTP 设置:

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;

Earlier to make it work, the GoDaddy SMTP host was:早些时候为了让它工作,GoDaddy SMTP 主机是:

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

Then GoDaddy SMTP host was changed to:然后GoDaddy SMTP 主机改为:

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

But Now GoDaddy SMTP host which works properly is:但是现在正常工作的 GoDaddy SMTP 主机是:

$mail->Host = 'localhost';

Also you can keep “SMTPAuth = false” and “Username/Password = Blank”.您也可以保留“SMTPAuth = false”和“Username/Password = Blank”。 It doesn't matters if you are using a GoDaddy Hosting Email or GoDaddy cPanel Email.如果您使用的是 GoDaddy 主机 Email 或 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('fromemail@domain.com');
//Receiver
$mail->addAddress('yourinbox@domain.com');

//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
}

I have same problem But I tried this我有同样的问题但我试过这个

$mail->SMTPAuth = false;

and HOSTNAME: relay-hosting.secureserver.net和 HOSTNAME: relay-hosting.secureserver.net

And Bingoooooo its working和Bingoooooo它的工作

please just do once this setting in SMTP请在 SMTP 中进行一次此设置

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.它对我有用。

GoDaddy/Linux (cPanel)/PHPMailer 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.随意为$mail->From$mail->FromName值使用任何您想要的电子邮件/名称。 Hope this helps.希望这可以帮助。

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:我对 email.php 进行了 AJAX 调用,其中包含:

 <?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!干杯!

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.在与这个问题搏斗了几天并让它工作后,我想我会在 2017 年更新这个线程。希望我可以节省一些人浪费的几个小时。 I am hosted on Godaddy with cpanel.我使用 cpanel 托管在 Godaddy 上。 It was the SMTPAutoTLS setting I finally ran across and tried that was the missing piece.这是我最终遇到并尝试过的 SMTPAutoTLS 设置,这是缺失的部分。 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 PHP 警告:stream_socket_enable_crypto():对等证书 CN= *.prod.iad2.secureserver.net' did not match expected CN=第 369 行 /home/username/public_html/classes/PHPMailer/class.smtp.php *.prod.iad2.secureserver.net' did not match expected CN= localhost' *.prod.iad2.secureserver.net' did not match expected CN=

Mailer Error: SMTP connect() failed.邮件程序错误:SMTP connect() 失败。 https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 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;  

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.在用尽我能想到的一切之后,我只是举起双手告诉 GoDaddy 将我切换回 Windows 服务器。 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.因此,对于任何认为自己已正确设置 PHPMailer 但无法使其工作的 GoDaddy 客户,我的建议是确定您是否在 Linux 服务器上。 It looks to me like GoDaddy has their Linux servers set up to block this type of mail transaction.在我看来,GoDaddy 已经设置了他们的 Linux 服务器来阻止这种类型的邮件交易。 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 设置是准确的,至少在 Windows 上是这样。

Maybe this will help save someone some time and frustration.也许这将有助于节省一些时间和挫折。 If anyone has a better idea, please post.如果有人有更好的想法,请发表。

Change this:改变这个:

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

To this:对此:

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

and it worked for me!它对我有用!

if on your hosting have a own email server, your email server using the following ports 25,465,587.如果您的主机上有自己的电子邮件服务器,则您的电子邮件服务器使用以下端口 25,465,587。 Settings for GoDaddy: 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;

Update for Jan 2015: I just had to solve this exact problem. 2015 年 1 月更新:我只需要解决这个确切的问题。 You need to have GoDaddy linux hosting with cPanel email accounts:您需要拥有带有 cPanel 电子邮件帐户的 GoDaddy linux 主机:

  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.在这里,您将看到 GoDaddy 现在为每个电子邮件地址创建定制的传入/传出服务器。 So use the outgoing server, SSL, auth:true, port:465, email/password.所以使用外发服务器、SSL、auth:true、端口:465、电子邮件/密码。

Hope that helps.希望有帮助。

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 的手动设置部分的设置

在此处输入图片说明

Godaddy is s nightmare. Godaddy 是个噩梦。

If you are using an older work space email account and are unfamiliar with cpanel try this如果您使用的是较旧的工作空间电子邮件帐户并且不熟悉 cpanel,请尝试此操作

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   = "info@signalhilltechnology.com";
              $mail->Password   = "allen1";
              //$mail->SMTPSecure = 'ssl';
              $mail->SetFrom('info@signalhilltechnology.com', 'Cagney');
              $mail->AddReplyTo("info@signalhilltechnology.com","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;
              }




}

Just had this problem, contacted GoDaddy and they switched my MX over from Local to Remote and it solved the problem instantly!刚遇到这个问题,联系了 GoDaddy,他们将我的 MX 从本地切换到远程,它立即解决了问题! Just a heads up for anyone that is still experiencing this issue.只是提醒仍然遇到此问题的任何人。

Updated 8-25-2019 For those seeking an answer to the proper way to set up Rd-Mailform and PHPmailer for Godaddy. 2019 年 8 月 25 日更新对于那些寻求为 Godaddy 设置 Rd-Mailform 和 PHPmailer 的正确方法的答案的人。

First off make sure that you have the latest files from Github.首先确保你有来自 Github 的最新文件。

Second here are the CORRECT settings for the Cpanel Email with SMTP and GODaddy第二个是带有 SMTP 和 GODaddy 的 Cpanel 电子邮件的正确设置

Edit the following file: rd-mailform.config.json (if your not using this file, then hard code in rd-mailform.php)编辑以下文件:rd-mailform.config.json(如果您不使用此文件,则在 rd-mailform.php 中进行硬编码)

File to edit is:rd-mailform.config.json要编辑的文件是:rd-mailform.config.json

~~~
 "useSmtp": false,
 "host": "localhost",              
 "port": 25,                                                     
 "username": "youraccountname@yourdoamin.com",                   
 "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现在,在您进行编辑之后,打开 rd-mailform.php 并将以下行编辑为如下: // 是否使用 SMTP 身份验证

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

That should work for all Godaddy servers using rd-mailform with phpmailer这应该适用于所有使用 rd-mailform 和 phpmailer 的 Godaddy 服务器

-D -D

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.经过数小时的艰苦工作,我意识到使用 go daddy,为 SSL 和 TLS 提供的配置邮件客户端主机详细信息不起作用。 For this reason you have to copy part of the Cpanel url as your host.出于这个原因,您必须将 Cpanel url 的一部分复制为您的主机。

**NB:**Make sure the url is what is resolved after typing your server ip and port on the search bar eg 0:0:0:0:2083 **注意:**确保在搜索栏上输入您的服务器 ip 和端口(例如 0:0:0:0:2083)后解析的 url

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你也可以在这里参考这个链接

GoDaddy Server SMTP Connection Refused. GoDaddy 服务器 SMTP 连接被拒绝。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM