mail.py 文件源码

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

项目:zing 作者: evernote 项目源码 文件源码
def send_mail(subject, message, from_email, recipient_list,
              fail_silently=False, auth_user=None, auth_password=None,
              connection=None, html_message=None, headers=None,
              cc=None, bcc=None):
    """Override django send_mail function to allow use of custom email headers.
    """

    connection = connection or get_connection(username=auth_user,
                                              password=auth_password,
                                              fail_silently=fail_silently)

    mail = EmailMultiAlternatives(subject, message,
                                  from_email, recipient_list,
                                  connection=connection, headers=headers,
                                  cc=cc, bcc=bcc)

    if html_message:
        mail.attach_alternative(html_message, 'text/html')

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


问题


面经


文章

微信
公众号

扫码关注公众号