Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to send emails in python

import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg.set_content('This is my message')

msg['Subject'] = 'Subject'
msg['From'] = "me@gmail.com"
msg['To'] = "you@gmail.com"

# Send the message via our own SMTP server.
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login("me@gmail.com", "password")
server.send_message(msg)
server.quit()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #send #emails #python
ADD COMMENT
Topic
Name
3+2 =