I remember those old times when i didn’t know nothing about computer programming and i was a member of the organization of the National Meeting of students of physiotherapy and after a conference about physiotherapy and spine related problems. At that time when we had to send some hundreds or even thousands of emails for other students and professional on that field, we spent hours or even days.
One of the problems was that our email provider (Gmail) didn’t allow to send a single email for more than ‘x’ people or send more than ‘y’ emails a day,if you had exceeded the limit they would block your account for the next 24 hours. For that problem the solution is don’t use Gmail for what it isn’t intended for. There are plenty other services to do that.
The other problem was the use of large files, full of emails adresses that we had to split through many emails. For this one, here is a possible solution, a script that connects to a SMTP server and sends the message to every contact in the “.txt” file.
from email.MIMEText import MIMEText
def send_to_all(server,login,passwd,subject,msg, cfile):
smtp=smtplib.SMTP(server, 465) #change for 587 if doesnt work
smtp.starttls() #comment this line if the server doesnt support TLS
for item in contacts:
#Asks the info to the user
print "Server: "
print "Login: "
print "Password: "
print "Subject: "
print "Message: "
print "Contacts file: "
#sends the message to all contacts in the file
send_to_all(server, login, passwd, subject, msg, cfile)
if __name__ == '__main__':
With this script you can only send simple text messages, but it might be usefull for someone anyway.