Last active
September 5, 2019 05:01
-
-
Save altafshaikh/9f3756ac266192ccc41ad59127a159b2 to your computer and use it in GitHub Desktop.
This is a python script to send mail using gmail account.
This file contains hidden or 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
##configuration | |
""" | |
1. Install yagmail | |
2. Install keyrings | |
3. Setup keyrings | |
""" | |
import yagmail | |
def send_mail(to,msg,sub): | |
receiver = to | |
body = msg | |
#filename = "mail.py" | |
sender = "your_mail_id" | |
yag = yagmail.SMTP(sender) | |
yag.send( | |
to=receiver, | |
subject=sub, | |
contents=body, | |
#attachments=filename, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment