【问题标题】:Symfony 3.4 and Swiftmailer - is it possible to send emails immediately/without spool?Symfony 3.4 和 Swiftmailer - 是否可以立即/不使用假脱机发送电子邮件?
【发布时间】:2019-07-25 02:25:51
【问题描述】:

我希望我的网络应用程序发送的电子邮件能够立即发送。但是,无论我尝试做什么,电子邮件都会不断被系统假脱机。我的app/config/config.yml

# Swiftmailer Configuration
swiftmailer:
    transport: '%mailer_transport%'
    host: '%mailer_host%'

当我将spool: { type: memory } 添加到配置时,在内核终止as it says in the docs 时不会发送假脱机。有没有办法强制立即交付?

【问题讨论】:

    标签: symfony swiftmailer


    【解决方案1】:

    如果您没有在配置中指定其他内容,邮件会立即发送而不是假脱机。
    你可以在guide查看它

    Symfony 邮件程序的默认行为是立即发送电子邮件。但是,您可能希望避免与电子邮件服务器的通信对性能造成影响,这可能会导致用户在发送电子邮件时等待下一页加载。

    只需在配置中省略spool 部分就可以了。

    如果电子邮件没有发送出去,可能是您的电子邮件服务器或与 Swift 邮件程序不直接相关的其他地方有错误。

    【讨论】:

      【解决方案2】:

      必须清除缓存。

      $ bin/console cache:clear --env=prod

      【讨论】:

        猜你喜欢
        • 2018-04-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-03
        • 2015-04-16
        • 2019-10-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多