usr bin python3 import smtplib user alexander ru pasw fromaddr alexand

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python3
import smtplib
user="alexander@**********.ru"
pasw="******"
fromaddr = "alexander@**********.ru"
toaddrs = "kepkin@******.com"
print("Enter message, end with ^D (Unix) or ^Z (Windows):")
# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\n\r\n"
% (fromaddr, ", ".join(toaddrs)))
msg = msg + "blbalba\n\n"
server = smtplib.SMTP('smtp.*****.cc',587)
server.set_debuglevel(1)
server.ehlo()
server.esmtp_features["auth"] = "LOGIN PLAIN"
server.login(user, pasw)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()