def send_email(emailconfig, emaillist, emailmessage, subject):
     email_config = SystemConfigService.get_email_config()
     print(email_config)
     emailSender = EmailHelper(email_config['Host'],email_config['User'] , email_config['Password'],
                               email_config['Postfix'],email_config['Port'])
     message = emailSender.generatetextmessage(emailmessage, subject, ','.join(emaillist), 'html')
     if email_config['Password'].strip() !="":
         worker = threading.Thread(target=emailSender.sendemaillogin, args=(emaillist, subject, message.as_string()))
         worker.start()
     else:
         worker = threading.Thread(target=emailSender.sendmail_nologin,
                                   args=(emaillist, subject, message.as_string()))
         worker.start()
Beispiel #2
0
 def sendemail(emailconfig, emaillist, emailmessage, subject):
     emailSender = EmailHelper(emailconfig['emailhost'],
                               emailconfig['user'], emailconfig['password'],
                               emailconfig['postfix'])
     for reciver in emaillist:
         index = 1
         message = emailSender.generatetextmessage(emailmessage, subject,
                                                   ','.join(emaillist),
                                                   'html')
         emailSender.sendemaillogin(','.join(emaillist), subject,
                                    message.as_string())
         emaillist = emaillist[index:]
         emaillist.append(reciver)
Beispiel #3
0
 def sendemail(emailconfig, emaillist, emailmessage, subject):
     emailSender = EmailHelper(BusinessService.HOST, BusinessService.USER,
                               BusinessService.PASSWORD,
                               BusinessService.POSTFIX,
                               BusinessService.PORT)
     message = emailSender.generatetextmessage(emailmessage, subject,
                                               ','.join(emaillist), 'html')
     if BusinessService.ISAUTH:
         emailSender.sendemaillogin(emaillist, subject, message.as_string())
     else:
         emailSender.sendmail_nologin(emaillist, subject,
                                      message.as_string())
Beispiel #4
0
 def sendemail(emailconfig, emaillist, emailmessage, subject):
     emailSender = EmailHelper(EmailService.HOST, EmailService.USER,
                               EmailService.PASSWORD, EmailService.POSTFIX,
                               EmailService.PORT)
     for reciver in emaillist:
         index = 1
         message = emailSender.generatetextmessage(emailmessage, subject,
                                                   ','.join(emaillist),
                                                   'html')
         if EmailService.ISAUTH:
             emailSender.sendemaillogin(','.join(emaillist), subject,
                                        message.as_string())
         else:
             emailSender.sendmail_nologin(','.join(emaillist), subject,
                                          message.as_string())
         emaillist = emaillist[index:]
         emaillist.append(reciver)