-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend.py
More file actions
28 lines (20 loc) · 705 Bytes
/
send.py
File metadata and controls
28 lines (20 loc) · 705 Bytes
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
import smtplib
def send_emails(title,msg):
server = smtplib.SMTP_SSL('smtp.yandex.com.tr', 465)
server.ehlo()
# server.starttls()
yandex_mail = "akylzhanova.gulnara@yandex.ru"
yandex_pass = "N7srk@GukaRauan1989"
send_to_email = "r.akylzhanov@qmul.ac.uk"
SUBJECT = "I love you"
title = "My email"
msg = ("From: %s\r\n To: %s\r\n\r\n"
% (yandex_mail, send_to_email))
#msg = "Let my people go"
message = 'Subject: {}\n\n{}'.format(SUBJECT, msg )
server.login(yandex_mail,yandex_pass)
#message = 'Subject: {}\n\n{}'.format(title,msg)
server.sendmail(yandex_mail,send_to_email,msg)
server.quit()
print('E-mails successfully sent!')
send_emails('Test Mail', 'Yes its a test mail!')