Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
smtp/smtp.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
14 lines (10 sloc)
1.12 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib #calling the smtp library | |
receivers=["ahmadkoki.trading@yahoo.com","ahmadkoki.jobs@yahoo.com"] #list of recievers | |
userName = input("Enter your Gmail") #sender's email address | |
passWord = input("Enter your pssword") #sender's password | |
Emessage = input("Enter your message here") #message displayes to recievers | |
server = smtplib.SMTP_SSL('smtp.gmail.com', 465) #establishing connecton to the gmail smtp server | |
server.login(userName, passWord) #giving your log in details, gotten from https://www.afternerd.com/blog/how-to-send-an-email-using-python-and-smtplib/ | |
for receiver_email in receivers: #iterating through the list of recievers | |
server.sendmail(userName, receiver_email, Emessage) #sending an email to the reciever | |
server.quit() #ending the program |