Python 3 Script to Send Email to Multiple Recipients Using smtplib Full Project For Beginners



This really works, I spent a lot of time trying multiple variants.


import smtplib
from email.mime.text import MIMEText

s = smtplib.SMTP('')
msg = MIMEText("""body""")
sender = ''
recipients = ['', '']
msg['Subject'] = "subject line"
msg['From'] = sender
msg['To'] = ", ".join(recipients)
s.sendmail(sender, recipients, msg.as_string())

Leave a Reply