首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误8085#0:*71722上游超时

错误8085#0:*71722上游超时
EN

Stack Overflow用户
提问于 2018-03-23 05:20:57
回答 1查看 78关注 0票数 0

目前,我正在尝试将Phpmailer用于一个学校项目。我对服务器和nginx了解不多。当我使用phpmailer的代码时,似乎没有发生任何事情,但过了一段时间后,我收到了这个错误警报:

从上游读取响应头时出现错误8085#0:*71722上游超时(110:连接超时),客户端: 2.203.50.189,服务器: delivery.nginx.xxxxxxxxxxxxxxxxxxxx.net,请求:"POST /register.php HTTP/1.1",上游:"fastcgi://127.0.0.1:9000",主机:"xxxxxxxxxxxxxxxxxxxxxxxx.net",referrer:"http://xxxxxxxxxxxxxxxxxxxxxx.net

如果有人知道如何解决这个问题,那就太棒了。非常感谢!

phpmailer的代码:

代码语言:javascript
复制
<?php
    use PHPMailer\PHPMailer\PHPMailer;
    date_default_timezone_set('Etc/UTC');
            require 'vendor/autoload.php';
            //Create a new PHPMailer instance
            //$mailer = new PHPMailer(true);
            $mail = new PHPMailer();
            //Set who the message is to be sent from
            $mail->isSMTP();
            //Enable SMTP debugging
            // 0 = off (for production use)
            // 1 = client messages
            // 2 = client and server messages
            $mail->SMTPDebug = 2;
            //Set the hostname of the mail server
            $mail->Host = 'xxxxxxxxxxxxxx';
            //Set the SMTP port number - likely to be 25, 465 or 587
            $mail->Port = 587;
            $mail->SMTPSecure = "ssl";
            //Whether to use SMTP authentication
            $mail->SMTPAuth = true;
            //Username to use for SMTP authentication
            $mail->Username = 'xxxxxxxxxxxxxxxxx';
            //Password to use for SMTP authentication
            $mail->Password = 'xxxxxxxxxxxxxxxxx';
            $mail->setFrom('xxxxxxxxxxxxxxxxx', 'xxxxxxxxx');
            //Set an alternative reply-to address
            //$mail->addReplyTo('replyto@example.com', 'First Last');
            //Set who the message is to be sent to

            $mail->AddAddress("xxxxxxxxxxxxx");
            //Set the subject line
            //$mail->Subject = 'PHPMailer SMTP test';
            //Read an HTML message body from an external file, convert                      referenced images to embedded,
            //convert HTML into a basic plain-text alternative body
            //$mail->Body = 'Test';
            $mail->msgHTML("test");
            //Replace the plain text body with one created manually
            //$mail->AltBody = 'This is a plain-text message body';
            //Attach an image file
            //$mail->addAttachment('images/phpmailer_mini.png');
            //send the message, check for errors

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

回答 1

Stack Overflow用户

发布于 2018-03-23 05:32:15

来自https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

您必须使用

使用ssl的端口465

端口587,带tls

您当前正在使用587的ssl

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49438685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档