from email.MIMEText import MIMEText message = """Hello, -- Anonymous""" msg = MIMEText(message) msg['To'] = '[email protected]' msg['From'] = 'Test Sender <[email protected]>' msg['Subject'] = 'Test Message' print msg.as_string()