payment_email.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:zing 作者: evernote 项目源码 文件源码
def send(self):
        """Sends the payment email along with the invoice."""
        body = self.get_body()

        # Set non-empty body according to
        # http://stackoverflow.com/questions/14580176/confusion-with-sending-email-in-django
        mail = EmailMultiAlternatives(subject=self.get_subject(),
                                      body=strip_tags(body),
                                      to=self.get_recipient_list(),
                                      cc=self.get_cc_list(),
                                      bcc=self.get_bcc_list())
        mail.attach_alternative(body, 'text/html')

        for attachment in self.attachments:
            mail.attach_file(attachment[0], attachment[1])

        return mail.send()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号