金字塔发送邮件:pyramid_mailer 或 marrow.mail
我有兴趣向基于 Pyramid 的网络应用添加传出电子邮件支持。我知道 Pyramid_mailer 和 marrow.mail(以前称为 TurboMail),其中包含金字塔集成示例此处。
有一个类似的问题,但它并没有完全给我经验丰富的意见寻找。
我对两者都没有经验,但两者看起来都做得相当不错。我的需求不大,而且流量非常低……如果它们发生冲突,易用性将胜过性能。两者都有适合我的传输支持(我不需要任何花哨的交付功能)。
乍一看,我喜欢pyramid_mailer支持repoze.tm2
事务挂钩,这对我的项目来说很方便(我确信我可以侵入marrow.mailer来做同样的事情,但我如果没有充分的理由,我宁愿不做这项工作)。而且我还喜欢 marrow.mailer 中的 Message() 正文支持嵌入图像(导致可能的结论是后者更完整)。
我正在寻找意见、建议,也许还有示例集成代码。
我发现涵盖此内容的邮件列表讨论 也。
I'm interested in adding outgoing email support to a Pyramid-based web-app. I'm aware of pyramid_mailer and marrow.mail (formerly known as TurboMail), with pyramid-integration example here.
There is a similar SO question, but it doesn't quite give me the experienced opinion I am looking for.
I have no experience with either, but both seem pretty reasonably well-cooked. My needs are modest, and will be very low traffic... ease of use would trump performance should they be in conflict. Both have transport support that will work for me (I don't need any fancy delivery features).
On first glance, I like that pyramid_mailer supports the repoze.tm2
transaction hook, which would be handy for my project (I'm sure I could hack-in marrow.mailer to do the same, but I'd rather not do that work without good reason). And also I like that embedded images are supported on the Message() body in marrow.mailer (leading to a possible conclusion that the latter is more fully formed).
I'm looking for opinions, recommendations, and maybe example-integration code.
I found a mailing-list discussion that covers this too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经验丰富的答案是,如果您只想通过 SMTP 服务器发送电子邮件,pyramid_mailer 更容易配置和执行。 Message 类来自 Lamson,它经过验证、稳定、经过测试,并且支持您可能想要在电子邮件中发送的任何内容,包括附件和 html。邮件程序还支持将所有消息简单地转储到队列目录,稍后您可以在其中运行 bin/qp /path/to/queue/dir 来异步发送电子邮件。
故事的另一面是 Turbomail 已经存在了一段时间,它现在更名为 marrow.mailer 并且支持大量后端,而不仅仅是 SMTP。 Alice 一直在积极致力于添加事务支持以与 repoze.tm2 集成,因此肯定有兴趣使 marrow.mailer 成为更具吸引力的解决方案。
The experienced answer is that if you just want to send email through a SMTP server, pyramid_mailer is way easier to configure and execute. The Message class is from Lamson, which is tried and true, stable, tested and supports whatever you might want to send in an email including attachments and html. The mailer also supports simply dumping all of the messages to a queue directory, where later you can just run
bin/qp /path/to/queue/dir
to send out the emails asynchronously.The other side of the story is that Turbomail has been around for a while, it's now renamed to marrow.mailer and supports a ton of backends, not just SMTP. Alice has been actively working on adding the transaction support to integrate with repoze.tm2, so there is definitely interest in making marrow.mailer a more attractive solution.