Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This is the email send v2 program. It can send messages from the terminal
- def how_many(username):
- toaddrs = []
- toaddrs.append(username)
- while True:
- print "Would you like to continue to add people to send messages to [Y/N]?"
- YN = raw_input(">>>")
- if YN.lower() == "y":
- print "Please enter the name of another person to send this email to."
- new_addr = raw_input(">>> ")
- toaddrs.append(new_addr)
- elif YN.lower() == "n":
- print "Ok, thanks!"
- break
- return toaddrs
- username = raw_input("What is the account name of your gmail?")
- password = raw_input("What is your password?")
- import smtplib
- fromaddr = username
- toaddrs = how_many(username)
- msg = raw_input("What is your message?")
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.ehlo()
- server.starttls()
- server.login(username,password)
- server.sendmail(fromaddr, toaddrs, msg)
- server.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement