Send email with Python

With gmail and Python you can send emails without having to go into gmail, but just with some Python’s code. Let’s see how.

You will need to generate the password like showed in the video

import smtplib

server = smtplib.SMTP("smtp.gmail.com", 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login("[email protected]","fhgdsfkhsdkfhsdkj") # substitute password
server.sendmail("[email protected]", # change user account
	"[email protected]", # change destination email
	"This is the message into the email") # change the message

server.quit()

 

Advertisement