【问题标题】:SMTP configuration | Ionos not receiving emailSMTP 配置 | Ionos 没有收到电子邮件
【发布时间】:2019-05-13 09:48:40
【问题描述】:

我在使用 Ionos smtp 配置时遇到了一些问题。 我将 Swiftmailer 与 Symfony 4 一起使用。 在本地,我使用 mailtrap 或 gmail 接收我的电子邮件,但在 ionos 的服务器上,它不适用于 gmail 或 SMTP 配置。 这是我的 .env 不同的配置:

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://email@gmail.com:PSW@localhost" <-- Work in local but not on Ionos
# MAILER_URL=smtp://smtp.mailtrap.io:2525?encryption=tls&auth_mode=login&username=LOGINMAILTRAP&password=PASSWORDMAILTRAP <-- Work in local and Ionos
MAILER_URL=smtp://smtp.ionos.fr:587?encryption=ssl&auth_mode=login&username=contact@mydomain.com&password=PWD <-- Doesn't work using Ionos SMTP config
###< symfony/swiftmailer-bundle ### 

这是我的 swiftmailer.yaml:

swiftmailer:
    url: '%env(MAILER_URL)%'
    spool: { type: 'memory' }

【问题讨论】:

    标签: symfony email smtp swiftmailer


    【解决方案1】:

    https://symfony.com/doc/current/email.html#configuration

    如果用户名、密码或主机包含在 URI 中被视为特殊的任何字符(例如 +、@、$、#、/、:、*、!),则必须对它们进行编码。有关保留字符的完整列表,请参阅 RFC 3986 或使用 urlencode 函数对其进行编码。

    【讨论】:

      【解决方案2】:

      尝试将加密从ssl 更改为tls

      这是一个例子:

      MAILER_URL=smtp://smtp.ionos.fr:587?encryption=tls&auth_mode=login&username=contact@mydomain.com&password=PWD
      

      如果密码包含任何特殊字符,请确保对密码进行 urlencode,如 @Fisher 所述

      【讨论】:

        猜你喜欢
        • 2016-12-19
        • 2016-09-30
        • 2020-09-25
        • 2018-06-01
        • 1970-01-01
        • 1970-01-01
        • 2018-05-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多