Emailing using python
import smtplib
import sys
import email
server = smtplib.SMTP('smtpip:port')
server.ehlo()
#msg = "Hello!" # The /n separates the message from the headers
msg = "\r\n".join([
"From:from@email.com",
"To: to@email.com",
"Subject: Test Message",
"",
"Why, oh why"
])
server.sendmail ("from@email.com", "to@email.com", msg)
import sys
import email
server = smtplib.SMTP('smtpip:port')
server.ehlo()
#msg = "Hello!" # The /n separates the message from the headers
msg = "\r\n".join([
"From:from@email.com",
"To: to@email.com",
"Subject: Test Message",
"",
"Why, oh why"
])
server.sendmail ("from@email.com", "to@email.com", msg)
Comments
Post a Comment