Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import smtplib
  2. from email.mime.text import MIMEText
  3.  
  4. USERNAME = 'xxx@gmail.com'
  5. PASSWORD = 'xxx'
  6.  
  7.  
  8. def send_mail (to):
  9. msg = MIMEText('coucou')
  10. msg['Subject'] = 'Salut ma couille 2'
  11. msg['From'] = "xxx@gmail.com"
  12. msg['To'] = to
  13. s = smtplib.SMTP('smtp.gmail.com:587')
  14. s.ehlo()
  15. s.starttls()
  16. s.login(USERNAME, PASSWORD)
  17. s.sendmail("xxx@gmail.com", [to], msg.as_string())
  18. s.quit()
  19.  
  20. def main():
  21. send_mail('xxx@étudiant.fr') # << here, the é is the problem
  22.  
  23. if __name__ == '__main__':
  24. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement