- smtp = smtplib.SMTP(conf.get('mail', 'smtp'))
- smtp.sendmail(mail['From'], mail['To'], mail.as_string())
- smtp.close()
+ sent = False
+ while not sent:
+ try:
+ smtp = smtplib.SMTP(conf.get('mail', 'smtp'))
+ smtp.sendmail(mail['From'], mail['To'], mail.as_string())
+ smtp.close()
+ sent = True
+ except smtplib.SMTPException, e:
+ log.warning('No se pudo enviar el mail a %s (%s)',
+ inscripto.padron, inscripto.mail)
+ time.sleep(1)