Ticket #7722: mail_fixed.diff
File mail_fixed.diff, 1.6 KB (added by , 16 years ago) |
---|
-
django/core/mail.py
194 194 multipart_subtype = 'mixed' 195 195 encoding = None # None => use settings default 196 196 197 def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,197 def __init__(self, subject='', body='', from_email=None, to=None, cc=None, bcc=None, 198 198 connection=None, attachments=None, headers=None): 199 199 """ 200 200 Initialize a single email message (which can be sent to multiple … … 208 208 self.to = list(to) 209 209 else: 210 210 self.to = [] 211 if cc: 212 self.cc = list(cc) 213 else: 214 self.cc = [] 211 215 if bcc: 212 216 self.bcc = list(bcc) 213 217 else: … … 241 245 msg['Subject'] = self.subject 242 246 msg['From'] = self.from_email 243 247 msg['To'] = ', '.join(self.to) 248 if self.cc is not None: 249 msg['Cc'] = ', '.join(self.cc) 244 250 msg['Date'] = formatdate() 245 251 msg['Message-ID'] = make_msgid() 246 252 for name, value in self.extra_headers.items(): … … 250 256 def recipients(self): 251 257 """ 252 258 Returns a list of all recipients of the email (includes direct 253 addressees as well as Bcc entries).259 addressees as well as Bcc and Cc entries). 254 260 """ 255 return self.to + self. bcc261 return self.to + self.cc + self.bcc 256 262 257 263 def send(self, fail_silently=False): 258 264 """Sends the email message."""