Swiftmailer:连接不能与主机smtp.gmail.com建立连接超时#110] [英] Swiftmailer: Connection could not be established with host smtp.gmail.com [Connection timed out #110]

查看:237
本文介绍了Swiftmailer:连接不能与主机smtp.gmail.com建立连接超时#110]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发贴是因为我已经在其他问题上发布了解决方案,但没有帮助。

I'm posting because I've already gone through the solutions posted in other questions on here but they haven't helped.

我正在努力做什么使用Swiftmailer通过Google Apps for Business Gmail发送电子邮件,但我不断收到以下错误:

What I am trying to do is send email using Swiftmailer through Google Apps for Business Gmail but I keep getting this error:


无法使用主机smtp.gmail建立连接.com [连接超时#110]

Connection could not be established with host smtp.gmail.com [Connection timed out #110]

我知道代码很好,因为它适用于我的本地机器,但不在生产服务器。

I know the code is fine because it works on my local machine but not on the production server.

目前为止我已经尝试过:

What I have tried so far:


  • 启用OpenSSL。 / li>
  • 从Google验证码中取消屏蔽帐户。

  • 使用特定于应用的密码。

  • 列出白名单的Gmail SMTP IP地址

配置:

# Swiftmailer Configuration
swiftmailer:
    transport:  smtp
    encryption: ssl
    auth_mode:  login
    host:       smtp.gmail.com
    username:   contact@mydomain.com
    password:   applicationspecificpassword
    port:       465

我还可以尝试什么?这可能是一个DNS问题,因为我使用Gmails SMTP MX记录而不是服务器。

What else can I try? Could this be a DNS issue since I am using Gmails SMTP MX records instead of the servers.

推荐答案

以下步骤为我工作


  1. 检查 httpd_can_sendmail 是否开启,运行此 getsebool httpd_can_sendmail


  • 当您获得: httpd_can_sendmail - >关闭,运行 setsebool -P httpd_can_sendmail 1

  • 当您获得 httpd_can_sendmail - > 时,步骤2中的动作很好。 li>
  • When you get: httpd_can_sendmail --> off , run setsebool -P httpd_can_sendmail 1
  • When you get: httpd_can_sendmail --> on that's fine move on step 2.

同时检查 httpd_can_network_connect 是否开启,运行 getsebool httpd_can_network_connect

Check also if httpd_can_network_connect is on, run getsebool httpd_can_network_connect


  • 当您获取 httpd_can_network_connect - >关闭运行 setsebool - p httpd_can_network_connect 1

  • 当您获得上的 httpd_can_network_connect - >时,步骤3中的动作很好。

  • When you get httpd_can_network_connect --> off run setsebool -P httpd_can_network_connect 1
  • When you get: httpd_can_network_connect --> on that's fine move on step 3.

我正在使用Centos

I'm using Centos

这篇关于Swiftmailer:连接不能与主机smtp.gmail.com建立连接超时#110]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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