gpt4 book ai didi

swiftmailer - SwiftMailer 是否像 Mail_Queue 一样支持异步邮件发送?

转载 作者:行者123 更新时间:2023-12-04 16:12:52 24 4
gpt4 key购买 nike

我想使用 sendgrid 的 SMTP 服务器发送我的电子邮件,但是连接到它们,不是在“网络时间”,而是通过(简单)队列。

我知道 PEAR 的 Mail_Queue 可以让我做到这一点,但我可以使用 SwiftMailer 做到这一点吗?

(SwiftMailer 和 Mail_Queue 之间的功能差异究竟是什么?)

谢谢!

最佳答案

SwiftMailer 有“线轴”选项。详情在Symfony cookbook .还有一些 Symfony 捆绑包将这个系统扩展到通过数据库进行假脱机,例如 WhiteOctoberSwiftMailerDBBundle .

从食谱:

# app/config/config.yml
swiftmailer:
# ...
spool:
type: file
path: /path/to/spool

现在,当您的应用程序发送电子邮件时,它实际上不会被发送,而是被添加到后台处理中。从假脱机发送消息是单独完成的。有一个控制台命令可以发送假脱机中的消息:
php app/console swiftmailer:spool:send --env=prod

关于swiftmailer - SwiftMailer 是否像 Mail_Queue 一样支持异步邮件发送?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6308359/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com