Python SMTP Gmail Limit

Viewed 1593

i am developing a program using python's smtplib which allows me to send emails to a group of people. i am aware that the gmail's policy regarding sending emails using SMTP is 500 emails per day, but is there a limit on how many instances i can use?

what i mean is for example i want to send 400 emails, can i open 4 instances of SMTP using my python script using the same email account and use each instance to send 100 emails?

i am using this simple script wherein i read the email addresses from a file

import smtplib


server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)

set_of_100_email_address = open('path','r')
for email in set_of_100_email_address:
    fromaddr = 'myemail@gmail.com'
    toaddrs  = email

    msg = 'message here'

    username = 'myemail@gmail.com'
    password = 'mypasswordhere'

    server.sendmail(fromaddr, toaddrs, msg)
    
server.quit()

thank you

(P.S. i know that gmail already has this functionality and there are alot of programs/codes out there that i can use but i just want to practice coding it myself and i am curious on how things work)

0 Answers
Related