【问题标题】:How do I change Swift Mailer configuration to spool emails when there is no config file when installed from composer从composer安装时没有配置文件时,如何将Swift Mailer配置更改为假脱机电子邮件
【发布时间】:2020-04-22 06:58:01
【问题描述】:

我已经使用 Composer 安装了 Swift Mailer,一切都已设置好并且运行良好。但现在我希望它使用假脱机而不是立即发送电子邮件。我能找到的小文档说我需要在 config/packages/swiftmailer.php 中指定某些设置,但我没有那个文件。

// config/packages/swiftmailer.php
$container->loadFromExtension('swiftmailer', [
    // ...
    'spool' => ['type' => 'memory'],
]);

如何设置 Swift Mailer 以使用假脱机而不是立即发送电子邮件?

【问题讨论】:

    标签: php symfony swiftmailer


    【解决方案1】:

    https://symfony.com/doc/current/email.html#configuration 之后是config/packages/swiftmailer.yaml 而不是.php

    如果您正在使用更旧(且未维护)的 Symfony 版本? 在这种情况下,它将位于app/config/config.yml (https://symfony.com/doc/2.8/email.html#configuration)

    【讨论】:

    • 我刚刚使用 composer 将 swiftmailer 安装到我的项目中。不使用整个 Symfony,只使用这个和其他几个包。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    • 1970-01-01
    • 2019-09-17
    • 1970-01-01
    • 2015-04-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多