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)

Comments

Popular posts from this blog

ScoreCard Model using R

The auxService:mapreduce_shuffle does not exist

Zeppelin and Anaconda