【问题标题】:smtp relay - gmail - swiftmailer: Expected response code 220 but got code ""smtp 中继 - gmail - swiftmailer:预期响应代码 220 但得到代码“”
【发布时间】:2011-06-23 20:46:08
【问题描述】:

我使用 gmail 作为我的 swiftmailer 类的 smtp 服务器。

不管怎样

预期的响应代码为 220,但得到代码“”,消息“”在“\classes\Swift\Transport\AbstractSmtpTransport.php”中

这是什么意思?

【问题讨论】:

  • 查明是什么,Gmail 需要 SSL 加密。

标签: php smtp gmail swiftmailer


【解决方案1】:

smtp-relay.gmail.com的用户,如果你在开发过程中使用localhost/127.0.0.1作为域名,你可能需要将EHLO命令中使用的域名更改为开始交易。

对于 SwiftMailer Symfony 捆绑包(自 2.4.0 起),您可以设置 local_domain config parameter

// config/packages/dev/swiftmailer.yaml
swiftmailer:
    ...
    local_domain: dev.mydomain.tld

【讨论】:

    【解决方案2】:

    当我在下面的 factory.yml 文件中设置错误时,我得到了这个。

    class: Swift_SendmailTransport

    但应该是下面这个。

    class: Swift_SmtpTransport

    【讨论】:

      【解决方案3】:

      我认为这可能意味着您向 smtp 服务器发送了一个空行。

      确保您的命令中没有换行符。

      您可以记录交易并粘贴日志副本吗?

      有关日志记录的详细信息,请参见此处 http://swiftmailer.org/docs/logger-plugin

      【讨论】:

        猜你喜欢
        • 2016-05-28
        • 2017-08-03
        • 2015-12-18
        • 2017-08-29
        • 2017-01-15
        • 2020-01-20
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多