1#>>>>>>>>>>>>>>>>>>> GIVE AN UP VOTE IF YOU LIKED IT <<<<<<<<<<<<<<<<<<<<<
2
3#Easiest and Readable way to Email
4#through Python SMTPLIB library
5#This works with >>> Gmail.com <<<
6import smtplib
7from email.message import EmailMessage
8
9EmailAdd = "Email id" #senders Gmail id over here
10Pass = "Email Password" #senders Gmail's Password over here
11
12msg = EmailMessage()
13msg['Subject'] = 'Subject of the Email' # Subject of Email
14msg['From'] = EmailAdd
15msg['To'] = 'abc@mail.com','xyz@mail.com' # Reciver of the Mail
16msg.set_content('Mail Body') # Email body or Content
17
18#### >> Code from here will send the message << ####
19with smtplib.SMTP_SSL('smtp.gmail.com',465) as smtp: #Added Gmails SMTP Server
20 smtp.login(EmailAdd,Pass) #This command Login SMTP Library using your GMAIL
21 smtp.send_message(msg) #This Sends the message