Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: python function 
Python :: how to loop through lines python 
Python :: gui def python 
Python :: rotate existing labels python 
Python :: def create(self validated_data) 
Python :: sort decreasing python 
Python :: 151 uva problem solution 
Python :: python how to write array into matlab file 
Python :: bar chart in python 
Python :: python system performance 
Python :: python selenium check if browser is open 
Python :: minio python make an object 
Python :: if syntax in python 
Python :: how to comment python 
Python :: lambda example python 
Python :: end without space in python 
Python :: python convert docx to pdf 
Python :: pandas append sheet to workbook 
Python :: docker run python 
Python :: Python NumPy stack Function Example with 1d array 
Python :: program python factorial 
Python :: python histogram one liners 
Python :: Check instance has an attribute in python 
Python :: Working with WTForms FieldList 
Python :: {} string python 
Python :: add element to array list python 
Python :: return variable python 
Python :: python colored text in console 
Python :: fixed size list in python 
Python :: regex find all sentences python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =