使用Mailgun服务提供商在Google Cloud上使用Swift Mailer发送电子邮件

时间:2018-02-24 22:42:16

标签: symfony smtp google-cloud-platform mailgun

我安装了Symfony 3.4应用程序和FOSUserBundle。我将应用程序部署到Compute Engine实例。但是,当我尝试在每次注册后发送电子邮件时,我收到以下错误。

 Exception occurred while flushing email queue: Connection could not be 
 established
 with host smtp.mailgun.org [Connection timed out #110] [] []

这是我的parameters.yml文件

parameters:
    mailer_transport: smtp
    mailer_host: smtp.mailgun.org
    mailer_user: postmaster@mydomain.tdl
    mailer_password: mailerpass

我也试过

mailer_host: smtp.mailgun.org:587

我将587传出端口添加到Google云平台上的防火墙规则列表中,但这也没有帮助。

2 个答案:

答案 0 :(得分:1)

在计算引擎上看起来应该使用端口2525,因为不允许端口25,465和587上的出站连接。您可以在Mailgun documentation和Google Cloud Platform documentation以及more上详细了解。

答案 1 :(得分:1)

Google Compute Engine具有设计阻止的所有标准传出SMTP端口。请在这里投票以改变Google的SMTP行为: https://googlecloudplatform.uservoice.com/forums/302595-compute-engine/suggestions/10079937-send-and-receive-email-using-tcp-smtp-imap-ports

在他们打开SMTP端口之前,没有好的办法从他们的云服务器发送电子邮件。 Sendgrid和其他的太贵了,缺乏许多需要的功能。

相关问题