

def set_message(self, message, mime_type='text/html', as_attachment=0, filename='attachment.html'):
    'Append the message with MIME content to the root node (as attachment)'
    from email.mime.text import MIMEText
    (maintype, subtype) = mime_type.split('/')
    part = MIMEText(mime_type, _subtype=subtype)
    if as_attachment:
        part.add_header('Content-Disposition', 'attachment', filename=filename)
    self.msg_root.attach(part)

dataset/ETHPy150Open frappe/frappe/frappe/email/email_body.py EMail.set_message/VarMisuse@52/96 `message`->`mime_type`