<legend id='jpNR6'><style id='jpNR6'><dir id='jpNR6'><q id='jpNR6'></q></dir></style></legend>
      <bdo id='jpNR6'></bdo><ul id='jpNR6'></ul>
  • <i id='jpNR6'><tr id='jpNR6'><dt id='jpNR6'><q id='jpNR6'><span id='jpNR6'><b id='jpNR6'><form id='jpNR6'><ins id='jpNR6'></ins><ul id='jpNR6'></ul><sub id='jpNR6'></sub></form><legend id='jpNR6'></legend><bdo id='jpNR6'><pre id='jpNR6'><center id='jpNR6'></center></pre></bdo></b><th id='jpNR6'></th></span></q></dt></tr></i><div id='jpNR6'><tfoot id='jpNR6'></tfoot><dl id='jpNR6'><fieldset id='jpNR6'></fieldset></dl></div>

      <tfoot id='jpNR6'></tfoot>
      1. <small id='jpNR6'></small><noframes id='jpNR6'>

      2. PHPMailer:使用远程 SMTP 服务器,在本地主机下工作,远程服务器上的连接被拒绝(111)

        时间:2024-08-23
            <bdo id='KmN1F'></bdo><ul id='KmN1F'></ul>

          • <small id='KmN1F'></small><noframes id='KmN1F'>

              <tbody id='KmN1F'></tbody>
          • <legend id='KmN1F'><style id='KmN1F'><dir id='KmN1F'><q id='KmN1F'></q></dir></style></legend>
              <i id='KmN1F'><tr id='KmN1F'><dt id='KmN1F'><q id='KmN1F'><span id='KmN1F'><b id='KmN1F'><form id='KmN1F'><ins id='KmN1F'></ins><ul id='KmN1F'></ul><sub id='KmN1F'></sub></form><legend id='KmN1F'></legend><bdo id='KmN1F'><pre id='KmN1F'><center id='KmN1F'></center></pre></bdo></b><th id='KmN1F'></th></span></q></dt></tr></i><div id='KmN1F'><tfoot id='KmN1F'></tfoot><dl id='KmN1F'><fieldset id='KmN1F'></fieldset></dl></div>
              <tfoot id='KmN1F'></tfoot>
                  本文介绍了PHPMailer:使用远程 SMTP 服务器,在本地主机下工作,远程服务器上的连接被拒绝(111)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在这里遇到了一个奇怪的问题.我正在尝试使用 PHPMailer 通过 SMTP 发送电子邮件.我有一个由 GoDaddy 托管的网站,我正在尝试使用该 SMTP 帐户发送邮件.

                  I've got a bizarre problem here. I'm trying to use PHPMailer to send an email, through SMTP. I have a website hosted by GoDaddy and it's that SMTP account that I'm trying to use to send the mail.

                  1. 如果我在本地服务器上执行我的 PHP 文件,它会起作用.
                  2. 如果我在 GoDaddy 的服务器上执行我的 PHP 文件,它不起作用.

                  我得到的错误信息是:

                  SMTP ->错误:无法连接到服务器:连接被拒绝(111)

                  我检查了本地主机和远程服务器上的 phpinfo.两者都将 smtp_port 列为 25.我在我的机器上使用 WAMP,服务器是某种形式的 Linux(我对此一无所知,也不知道如何管理).

                  I checked phpinfo on both localhost and the remote server. Both have smtp_port listed as 25. I'm using WAMP on my machine and the server is some form of Linux (which I know nothing about and have no idea how to administer).

                  这里是有问题的代码:

                  INDEX.PHP:

                  <?php
                  date_default_timezone_set('America/Los_Angeles');
                  include_once("phpmailer/class.phpmailer.php");
                  
                  $mail = new PHPMailer;
                  $mail->SMTPDebug = 1;
                  $mail->Port = 25;
                  
                  $mail->IsSMTP();
                  $mail->Host = 'smtpout.secureserver.net';
                  $mail->SMTPAuth = true;
                  $mail->Username = 'username@site.com';
                  $mail->Password = 'super_secret_password';
                  $mail->SMTPSecure = ''; // tried ssl and tls, with same result
                  
                  $mail->ClearAddresses();
                  $mail->AddAddress('receiver@hotmail.com', 'Receiver Name');
                  $mail->From = "username@site.com";
                  $mail->FromName = "Username";
                  $mail->Subject = 'Hi there';
                  $mail->Body = "This is a message";
                  
                  if ($mail->Send()) {
                      echo "Message sent!
                  ";
                  }
                  else {
                      echo "Message failed!
                  ";
                      print_r($mail->ErrorInfo);
                  }
                  
                  exit();
                  ?>
                  

                  推荐答案

                  我觉得你应该分两步1)按照godaddy支持http://support.godaddy.com/help/article/319/what-do-i-do-if-i-have-trouble-connecting-to-my-电子邮件帐户2)使用relay-hosting.secureserver.net"作为您的主机,而不是smtpout.secureserver.net"

                  I think you should perform two step 1) check your port as suggested on godaddy support http://support.godaddy.com/help/article/319/what-do-i-do-if-i-have-trouble-connecting-to-my-email-account 2)use "relay-hosting.secureserver.net" as your host instead of "smtpout.secureserver.net"

                  GoDaddy 确实允许使用 Gmail 作为您的 SMTP 发送电子邮件,只需摆脱 smtp.gmail.com 并改用其主机即可.这是我的设置:

                  GoDaddy does allow to send emails using Gmail as your SMTP, just need to get rid of the smtp.gmail.com and use their Host instead. This is my setup:

                  $mail = new PHPMailer();
                  $mail->isSMTP();
                  $mail->Host = "relay-hosting.secureserver.net";
                  $mail->Username = "your-account@gmail.com";
                  $mail->Password = "yourpassword";
                  // ...
                  // send from, send to, body, etc...
                  

                  参考(见前两篇文章)http://support.godaddy.com/groups/web-hosting/forum/topic/phpmailer-with-godaddy-smtp-email-server-script-working/

                  这篇关于PHPMailer:使用远程 SMTP 服务器,在本地主机下工作,远程服务器上的连接被拒绝(111)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Bluehost 上使用 phpMailer isSMTP? 下一篇:smtp 中继 - gmail - swiftmailer:预期响应代码 220 但得到代码“"

                  相关文章

                      <bdo id='AFhhl'></bdo><ul id='AFhhl'></ul>

                      <small id='AFhhl'></small><noframes id='AFhhl'>

                      <tfoot id='AFhhl'></tfoot>

                      <i id='AFhhl'><tr id='AFhhl'><dt id='AFhhl'><q id='AFhhl'><span id='AFhhl'><b id='AFhhl'><form id='AFhhl'><ins id='AFhhl'></ins><ul id='AFhhl'></ul><sub id='AFhhl'></sub></form><legend id='AFhhl'></legend><bdo id='AFhhl'><pre id='AFhhl'><center id='AFhhl'></center></pre></bdo></b><th id='AFhhl'></th></span></q></dt></tr></i><div id='AFhhl'><tfoot id='AFhhl'></tfoot><dl id='AFhhl'><fieldset id='AFhhl'></fieldset></dl></div>
                    1. <legend id='AFhhl'><style id='AFhhl'><dir id='AFhhl'><q id='AFhhl'></q></dir></style></legend>