Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create smtp server python

import smtplib

username = 'user'
password = 'pwd'

from_addr = 'username@gmail.com'
to_addrs = 'username@gmail.com'

msg = "
".join([
  "From: username@gmail.com",
  "To: username@gmail.com",
  "Subject: subject",
  "",
  "message"
  ])

server = smtplib.SMTP('YOUR_SMTP_EMAIL_ADDRESS')
server.ehlo()
server.starttls()
server.login(username, password)
server.sendmail(from_addr, to_addrs, msg)
server.quit()
 
PREVIOUS NEXT
Tagged: #create #smtp #server #python
ADD COMMENT
Topic
Name
3+6 =