﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7722	EMail Message with CC - Carbon CopyFixed patch	roberto.digirolamo <robydigi91@…>	nobody	"I modified class EmailMessage for use Carbon copy.

{{{
    def __init__(self, subject='', body='', from_email=None, to=None, cc=None, bcc=None,
            connection=None, attachments=None, headers=None):
        """"""
        Initialize a single email message (which can be sent to multiple
        recipients).

        All strings used to create the message can be unicode strings (or UTF-8
        bytestrings). The SafeMIMEText class will handle any necessary encoding
        conversions.
        """"""
        if to:
            self.to = list(to)
        else:
            self.to = []
        if cc:
			self.cc = list(cc)
		else:
			self.cc = []
        if bcc:
            self.bcc = list(bcc)
        else:
            self.bcc = []
        self.from_email = from_email or settings.DEFAULT_FROM_EMAIL
        self.subject = subject
        self.body = body
        self.attachments = attachments or []
        self.extra_headers = headers or {}
        self.connection = connection

	def message(self):
		encoding = self.encoding or settings.DEFAULT_CHARSET
		msg = SafeMIMEText(smart_str(self.body, settings.DEFAULT_CHARSET), self.content_subtype, encoding)
		if self.attachments:
			body_msg = msg
			msg = SafeMIMEMultipart(_subtype=self.multipart_subtype)
			if self.body:
				msg.attach(body_msg)
			for attachment in self.attachments:
				if isinstance(attachment, MIMEBase):
					msg.attach(attachment)
				else:
					msg.attach(self._create_attachment(*attachment))
		msg['Subject'] = self.subject
		msg['From'] = self.from_email
		msg['To'] = ', '.join(self.to)
		if not self.cc == None:
			msg['Cc'] = ', '.join(self.cc)
		msg['Date'] = formatdate()
		msg['Message-ID'] = make_msgid()
		for name, value in self.extra_headers.items():
			msg[name] = value
		return msg

	def recipients(self):
		""""""
		Returns a list of all recipients of the email (includes direct
		addressees as well as Bcc and Cc entries).
		""""""
		return self.to + self.cc + self.bcc
}}}


Best regards,
Roberto"		closed	Core (Mail)	dev		fixed		robydigi91@… django@… richard.davies@… dougvanhorn@… tom@… alex-sort.django@…	Ready for checkin	1	0	0	0		
