Python Emailing Multipart con contenido de cuerpo
No puedo enviar un correo electrónico en python con un cuerpo como un correo electrónico de varias partes. Todo lo que he intentado ha resultado en todo el contenido como archivos adjuntos, y no puedo hacer que el texto o html aparezca en el cuerpo.
msg = MIMEMultipart()
if msg_mime_type == 'text' or not msg_mime_type:
new_body = MIMEText(body, 'text')
elif msg_mime_type == 'image':
new_body = MIMEImage(body)
elif msg_mime_type == 'html':
new_body = MIMEText(body, 'html')
new_body.add_header('Content-Disposition', 'inline', filename='body')
msg.set_payload(new_body) #also tried msg.attach(new_body)
Necesito usar unMultipart
para que yo también pueda agregar archivos adjuntos, pero mantuve ese código para simplificar.