def set_message(self, message, mime_type='text/html', as_attachment=0, filename='attachment.html'):
		from email.mime.text import MIMEText

		maintype, subtype = mime_type.split('/')
		part = MIMEText(message, _subtype = subtype)

		if as_attachment:
			part.add_header('Content-Disposition', 'attachment', filename=filename)

		self.msg_root.attach(part)
Append the message with MIME content to the root node (as attachment)
dataset/ETHPy150Open frappe/frappe/frappe/email/email_body.py/EMail.set_message