-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmail.py
33 lines (24 loc) · 884 Bytes
/
mail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Mail():
@classmethod
def Send_Email(cls):
import smtplib
gmail_user = "torrentnotifier2@gmail.com"
gmail_pwd = "broke_ender9"
FROM = "torrentnotifier2@gmail.com"
TO = "sid.sharma0@gmail.com"
SUBJECT = "Your filters have matched Torrent results"
msg = "Torrents have been found matching your query!"
BODY = '\r\n'.join(['To: {}'.format(TO),
'From: {}'.format(FROM),
'Subject: {}'.format(SUBJECT),
'', msg])
s = smtplib.SMTP("smtp.gmail.com", 587)
s.ehlo()
s.starttls()
s.login(gmail_user,gmail_pwd)
try:
s.sendmail(FROM, [TO], BODY)
print ('email sent')
except:
print ('error sending mail')
s.quit()