-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (25 loc) · 891 Bytes
/
main.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
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
login = input ('SMTP login :')
password = input ('SMTP pass :')
msg = MIMEMultipart('mixed')
sender = input ('sender mail :')
recipient = input ('recipient mail :')
msg['Subject'] = input ('Subject :')
msg['From'] = sender
msg['To'] = recipient
text_message = MIMEText('Mesaj Buraya Yazilacak.(Message is here)', 'plain')
html_message = MIMEText('Buda resim falan eklersen diye Mesaj yani.(With images Messages)', 'html')
msg.attach(text_message)
msg.attach(html_message)
mailServer = smtplib.SMTP('smtp-relay.brevo.com', 587) # 8025, 587 and 25 can also be used.
mailServer.ehlo()
mailServer.ehlo()
mailServer.login(login, password)
mailServer.sendmail(sender, recipient, msg.as_string())
mailServer.close()
try:
print ("Mail Gonderildi")
except:
print ("Mail Gonderilemedi")