在 symfony 中发送电子邮件
我在 symfony 1.4.8(以及 Doctrine 作为 ORM)中使用 swiftmailer (传输)来发送我的邮件。
我已经按照书上的说明配置了一切。
dev:
mailer:
class: sfMailer
param:
delivery_strategy: spool
spool_class: Swift_DoctrineSpool
spool_arguments: [ MailMessage, message, getSpooledMessages ]
transport:
class: Swift_SmtpTransport
param:
host: something
port: 26
encryption: ~
username: something
password: something
问题是当我使用实时策略时,发送邮件需要太多时间,用户应该等到它完成。然后动作就完成了,你可以看到结果。这对我来说不好,因为我想发送一封验证邮件以进行用户注册,如果速度很慢,用户将在注册过程中入睡。
而且我也不能使用假脱机策略。因为我必须通过任务手动发送它们(我对吗?),而我也不能这样做。因为注册后应该会自动发送。
那么针对这种情况有策略吗?这对于发送电子邮件来说已经足够快了(无需等到发送)
I'm using swiftmailer (transport) in symfony 1.4.8 (and Doctrine as ORM) to send my mails.
I've configured everything as the book says.
dev:
mailer:
class: sfMailer
param:
delivery_strategy: spool
spool_class: Swift_DoctrineSpool
spool_arguments: [ MailMessage, message, getSpooledMessages ]
transport:
class: Swift_SmtpTransport
param:
host: something
port: 26
encryption: ~
username: something
password: something
The problem is when I'm using realtime strategy , it takes too much time to send the mail and user should wait till it's done. Then the action is done and you can see the result . This is not good for me because I want to send a verification mail for user registration and if this is slow, user will fall sleep during the registration.
And I can't use spool strategy either. Because I have to send them manually with the task (am I right? ) and I can't do that too. Because it should be sent automatically after the registration.
So is there a strategy for this situation? That is fast enough for sending emails(without need to wait until it's sent)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用实时策略发送电子邮件,有时循环发送数百封电子邮件。我发现电子邮件,尤其是在序列的早期发送时,相对较快。
我使用了以下技术:
根据我的经验,一封确认电子邮件应该非常方便。如果不是,我会寻找其他(命令行)方法来调试该事务以查看瓶颈所在。我怀疑是 PHP、Symfony 还是 Swift。
I send emails using a realtime strategy, and sometimes hundreds in a loop. I find that emails, especially when sent early in the sequence, are relatively quick.
I've used the following techniques:
In my experience, a single confirmation email should be very expedient. If it isn't I would seek out other (command-line) ways to debug that transaction to see where you bottleneck is. I doubt that its PHP, Symfony or Swift.