Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有用于创建用户可以下载的网页 PDF 的代码。我想使用Amazon SES通过邮件将此 PDF 作为附件发送。
提前致谢!
我只需将 PDF 输出/保存在服务器上的临时位置,例如 /tmp/hello.pdf,然后将其附加到电子邮件中:
from django.core.mail import EmailMessage email = EmailMessage('Hello', 'Body goes here', 'from@example.com', ['to1@example.com']) email.attach_file('/tmp/hello.pdf') email.send()
G