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

问题描述 投票:0回答:2

我安装了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: [email protected]
    mailer_password: mailerpass

我也试过了

mailer_host: smtp.mailgun.org:587

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

symfony smtp google-cloud-platform mailgun
2个回答
1
投票

在Compute Engine上看起来应该使用端口2525,因为端口25,465和587上的出站连接是不允许的。您可以在Mailgun documentation和Google Cloud Platform documentationmore上阅读更多内容。


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和其他的太昂贵,缺乏许多需要的功能。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.