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.
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.
精彩评论