Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import smtp library
- import smtplib
- #define connection parameters
- source = 'user1@gmail.com'
- dest = 'user2@gmail.com'
- #define message
- word = "\r\n".join([
- "source: user1@gmail.com",
- "To: user2@gmail.com",
- "Subject: Buenas dias",
- "",
- "Yo soy Pato"
- ])
- #define the password for source
- passw = 'xxxxxxxx'
- #set the smtp server
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.ehlo()
- server.starttls()
- server.login(source,passw)
- server.sendmail(source, dest, word)
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement