###### Notice ###### # before sending email you have to enable your less secure apps access in your sending mail (xyz@gmail.com) import smtplib from email.message import EmailMessage EMAIL_ADDRESS = "xyz@gmail.com" # your email-id goes here EMAIL_PASSWORD = "xyz" # your password goes here msg = EmailMessage() msg['Subject'] = 'this is subject' msg['From'] = EMAIL_ADDRESS msg['To'] = EMAIL_ADDRESS msg.set_content('Content area') msg.add_alternative("""\