Last active
September 23, 2016 07:08
-
-
Save renjithsraj/b16dd135929d2bc94f4e1375bc019f72 to your computer and use it in GitHub Desktop.
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
from threading import Thread | |
import requests ## pip install requests | |
import time | |
import smtplib | |
## email sending function | |
def email_sender(input_message, email_to): | |
''' function to send email ''' | |
to = email_to | |
gmail_user = 'your email' | |
gmail_pwd = 'email password' | |
smtpserver = smtplib.SMTP("smtp.gmail.com",587) | |
smtpserver.ehlo() | |
smtpserver.starttls() | |
smtpserver.ehlo | |
smtpserver.login(gmail_user, gmail_pwd) | |
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject:site down! \n' | |
input_message = input_message | |
msg = header + input_message | |
smtpserver.sendmail(gmail_user, to, msg) | |
smtpserver.close() | |
a = email_sender("hello","renjith.r@tringapps.com") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment