6 lis 2016 - When I need to mail in python, I use the mailgun API wich get's a lot of the headaches . SMTP(SERVER) "New part" server.starttls() server.login('username', .