Ticket #6840: 6840_mail_cc.diff

File 6840_mail_cc.diff, 1.5 KB (added by Philippe Raoult, 17 years ago)
  • django/core/mail.py

     
    189189    multipart_subtype = 'mixed'
    190190    encoding = None     # None => use settings default
    191191
    192     def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,
     192    def __init__(self, subject='', body='', from_email=None, to=None, cc=None, bcc=None,
    193193            connection=None, attachments=None, headers=None):
    194194        """
    195195        Initialise a single email message (which can be sent to multiple
     
    203203            self.to = list(to)
    204204        else:
    205205            self.to = []
     206        if cc:
     207            self.cc = list(cc)
     208        else:
     209            self.cc = []
    206210        if bcc:
    207211            self.bcc = list(bcc)
    208212        else:
     
    237241        msg['To'] = ', '.join(self.to)
    238242        msg['Date'] = formatdate()
    239243        msg['Message-ID'] = make_msgid()
     244        if self.cc:
     245            msg['Cc'] = ', '.join(self.cc)
    240246        if self.bcc:
    241247            msg['Bcc'] = ', '.join(self.bcc)
    242248        for name, value in self.extra_headers.items():
     
    248254        Returns a list of all recipients of the email (includes direct
    249255        addressees as well as Bcc entries).
    250256        """
    251         return self.to + self.bcc
     257        return self.to + self.cc + self.bcc
    252258
    253259    def send(self, fail_silently=False):
    254260        """Send the email message."""
Back to Top