【问题标题】:Timeout error when sending outgoing mail via SMTP & PHPMailer通过 SMTP 和 PHPMailer 发送外发邮件时出现超时错误
【发布时间】:2015-12-16 03:26:12
【问题描述】:

我正在尝试配置 Digital Ocean droplet 以使用我的 Gmail 帐户的 SMTP 服务器发送外发邮件,但我收到以下错误:

2015/12/15 22:15:33 [错误] 14940#0: *31 上游超时(110:连接超时)同时从上游读取响应头,客户端:173.245.54.200,服务器:kokorugs.com ,请求:“POST /wp-admin/options-general.php?page=swpsmtp_settings&w3tc_note=flush_pgcache HTTP/1.1”,上游:“fastcgi://127.0.0.1:9000”,主机:“kokorugs.com”,推荐人: "https://kokorugs.com/wp-admin/options-general.php?page=swpsmtp_settings&w3tc_note=flush_pgcache"

我在 HHVM 和 nginx 上运行 WordPress。

电子邮件由PHPMailer 发送,这是导致超时的特定行:

if ( ! $mail->Send() )

我已经按照here 的描述将我的 droplet 配置为取消 IPv6 NS 查找的优先级。

如果重要的话,我也在使用 CloudFlare。

什么可能导致此超时?

更新: 电子邮件发送得很好。但是服务器仍然超时。

【问题讨论】:

    标签: php nginx smtp phpmailer


    【解决方案1】:

    问题是我的 Digital Ocean 液滴上没有安装 MTA

    我遵循了这些说明:

    https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04

    并将postfix 设置为仅发送的 smtp 服务器。

    接下来,我设置了 Google Apps SMTP Relay 以允许来自我的 Google Apps 地址的电子邮件。

    这样,已发送的电子邮件将保存在我的 gmail 的已发送文件夹中,并且电子邮件被标记为垃圾邮件的可能性大大降低。

    【讨论】:

      猜你喜欢
      • 2023-04-01
      • 2014-02-21
      • 2019-05-06
      • 1970-01-01
      • 2015-02-21
      • 2016-07-27
      • 2017-11-04
      • 2014-01-04
      相关资源
      最近更新 更多