

def send_mail(subject, message_plain, message_html, email_from, email_to, custom_headers={
    
}, attachments=()):
    '\n    Build the email as a multipart message containing\n    a multipart alternative for text (plain, HTML) plus\n    all the attached files.\n    '
    if ((not message_plain) and (not message_html)):
        raise ValueError(_('Either message_plain or message_html should be not None'))
    if (not message_plain):
        message_plain = html2text(message_html)
    message = {
        
    }
    message['subject'] = subject
    message['body'] = message_plain
    message['from_email'] = email_from
    message['to'] = email_to
    if attachments:
        message['attachments'] = attachments
    if custom_headers:
        message['headers'] = custom_headers
    msg = EmailMultiAlternatives(**message)
    if subject:
        msg.attach_alternative(message_html, 'text/html')
    msg.send()

dataset/ETHPy150Open bread-and-pepper/django-userena/userena/mail.py send_mail/VarMisuse@143/271 `message_html`->`subject`