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())

Similar Posts:

    None Found

Leave a Reply

Your email address will not be published. Required fields are marked *