Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib
- from email.mime.text import MIMEText
- USERNAME = 'xxx@gmail.com'
- PASSWORD = 'xxx'
- def send_mail (to):
- msg = MIMEText('coucou')
- msg['Subject'] = 'Salut ma couille 2'
- msg['From'] = "xxx@gmail.com"
- msg['To'] = to
- s = smtplib.SMTP('smtp.gmail.com:587')
- s.ehlo()
- s.starttls()
- s.login(USERNAME, PASSWORD)
- s.sendmail("xxx@gmail.com", [to], msg.as_string())
- s.quit()
- def main():
- send_mail('xxx@étudiant.fr') # << here, the é is the problem
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement