sending email in python with gmail

A {{Python}} nugget from {{Programming Your Home}} (review) I wanted to share from p97: import smtplib def send_email(subject, message) recipient = ‘your_email_recipient@domain.tld’ gmail_sender = ‘your_gmail_account@gmail.com’ gmail_password = ‘your_gmail_password’ #use tls gmail_smtp = smtplib.SMTP(‘smtp.gmail.com’, 587) gmail_smtp.ehlo() gmail_smtp.starttls() gmail_smtp.ehlo() #login gmail_smtp.login(gmail_send, gmail_password) #message formatting mail_header = ‘To: ‘ + recipient + ‘\n’ + ‘From: ‘ + gmail_sender …
Continue reading sending email in python with gmail