"\" # still in string " '\' # still in string ' import smtplib smtpServer='smtp.yourdomain.com'; fromAddr='xah@xahlee.org'; toAddr='xah@xahlee.org'; text='''Subject: newfound love Hi friend, long time no write, i have a new manifesto i think it would be of interest for you to peruse. ... ''' server = smtplib.SMTP(smtpServer) server.set_debuglevel(1) server.sendmail(fromAddr, toAddr, text) server.quit()