如何使用模板方法在Plone中发送带有附件的邮件? [英] How to send mail with attachments in Plone using a template approach?
问题描述
我一直在阅读有关从Plone发送电子邮件的官方文档
I've been reading the official docs about sending emails from Plone using some templates, and it's working so far.
我的问题是:如何使用模板方法添加附件?
My question is: how do I add attachments using the template approach?
推荐答案
MailHost.send命令采用python(unicode)字符串和email.Message对象。这意味着您可以使用 python电子邮件包来构建具有附件的正确MIME邮件。
The MailHost.send command takes both python (unicode) strings and email.Message objects. That means you can use the python email package to construct a proper MIME message with attachments.
标准库包括一个很棒的例子;任何文本仍然可以通过模板生成,就像您链接的文档一样。
The standard library includes a great page of examples; any text can still be generated by templates just like in the documentation you linked.
这篇关于如何使用模板方法在Plone中发送带有附件的邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!