emails.py 文件源码

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

项目:munch-core 作者: crunchmail 项目源码 文件源码
def __init__(self, to, subject, template, render_context={}):

        if not isinstance(to, list):
            to = [to]

        render_context.update({'application_message_recipient': to[0]})
        self.render_context = render_context
        body = render_to_string(template, render_context)

        # Use max line length from RFC2822 (78) instead of RFC5322 (998)
        # to force conversion to quoted-printable in almost all cases
        django.core.mail.message.RFC5322_EMAIL_LINE_LENGTH_LIMIT = 78

        self.msg = EmailMultiAlternatives(
            subject=subject, body=body, to=to, from_email=self.message_from,
            headers={
                'Auto-Submitted': 'auto-generated',
                'Return-Path': settings.SERVICE_MSG_RETURN_PATH,
                'Message-ID': mk_msgid()
            },
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号