示例#1
0
 def send(self):
     headers = {}
     if self.cc:
         headers['Cc'] = ', '.join(self.cc)
     if self.reply_to:
         headers['Reply-To'] = ', '.join(self.reply_to)
     msg = _EmailMessage(self.subject, self.body, self.sender,
                         self.to, self.cc + self.bcc, headers=headers)
     msg.send(fail_silently=True)
示例#2
0
def send_mail_to_admins(sender, subject, body, **kw):
    _EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, body,
                  settings.SERVER_EMAIL, [a[1] for a in settings.ADMINS],
                  headers=kw).send(fail_silently=True)