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'] = "[email protected]"
msg['To'] = "[email protected]"
# Send the message via our own SMTP server.
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login("[email protected]", "password")
server.send_message(msg)
server.quit()