Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def smtp_gmail():
- username = "mmera email"
- password = "mera password"
- smtp_server = "smtp.gmail.com:587"
- email_from = "shantanusaxena135@gmail.com"
- email_to = "shantanu.saxena@dusragmail.com"
- mystring = 'CONTENT'
- email_body = string.join((
- "From: %s" % email_from,
- "To: %s" % email_to,
- "Subject: This is my subject line!",
- "",
- "This is my message that can also have a %s" % (mystring),), "\r\n"
- )
- server = smtplib.SMTP(smtp_server)
- server.starttls()
- server.login(username, password)
- server.sendmail(email_from, email_to, email_body)
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement