Beispiel #1
0
def send_email(subject, template, to_list, *args):
    mail_sender = MailSender.getInstance()
    mail_sender.init_conf({
        'server': '172.16.255.214:465',
        'user': '******',
        'passwd': 'i18P@55word',
        'from': 'I18N Studio<*****@*****.**>',
        'to': []
    })
    try:
        f = open(template, 'r')
        s = f.read()
        html_str = s % args
        mail_sender.send(subject, html_str, to_list)
    except Exception, e:
        _LOGGER.error("read file and format occurred exception:%s" % e)
Beispiel #2
0
 def __init__(self, app_name, broker='redis://localhost:6379/1'):
     self.app_name = app_name
     self.celery_app = Celery('scheduler',
                              broker=broker)
     self.mail_sender = MailSender.getInstance()