I am sending a plain text email as follows:
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def send_mess
The same way, using msg.attach:
msg.attach
from email.mime.text import MIMEText filename = "text.txt" f = file(filename) attachment = MIMEText(f.read()) attachment.add_header('Content-Disposition', 'attachment', filename=filename) msg.attach(attachment)