[admin/controle_chartes_MA.py] on envoie bien les mails à tout le monde

darcs-hash:20091109025451-bd074-5a33a9e892966337c0ac328c3c49209da3ecd56a.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-11-09 03:54:51 +01:00
parent f0da55bf97
commit 35c4bff00e

View file

@ -140,14 +140,16 @@ def spammer():
# On envoi un mail à chacun de ces membres actifs
from smtplib import SMTP
connexion = SMTP()
connexion.connect("rouge.crans.org")
if gethostname().split(".")[0] == 'rouge':
connexion.connect("localhost")
else: connexion.connect("rouge.crans.org")
print "Envoi des mails de rappel pour les chartes des membres actifs"
for adh in todo_list:
to = adh.email()
print to
if not debug:
data = config.txt_charte_MA.encode('utf-8') % {'From' : u"ca@crans.org", 'To' : to}
data = config.txt_charte_MA % {'From' : u"ca@crans.org", 'To' : to}
connexion.sendmail("ca@crans.org",to,data.encode('iso-8859-15'))
def __usage(message=None):