Jump to content
Sign in to follow this  
devil22

Nie działa kod do masowego wysyłania emaili z gmaila

Recommended Posts

import smtplib

with open("to.txt", 'r') as f:
    maile = [a.strip() for a in f.readlines() if a.strip()]
    print(maile)
gmail_user = ''
gmail_password = ''
sent_from = gmail_user
email_text = 'tekst'
try:
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.login(gmail_user, gmail_password)
    for x in maile:
        server.sendmail(sent_from, x, email_text)
except:
    print('Hej')

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...