Django 1.3 will add the argument "cc" to EmailMessage, which is great. How can I simulate this with Django 1.2?
First, I tried this:
headers = None
if form.cleaned_data['cc_sender']:
headers = {'Cc': sender}
msg = EmailMultiAlternatives(subject, message, sender, recipients, headers=headers)
msg.attach_alternative(replace(convert(message)), 'text/html')
msg.send(fail_silently=False)
Set the "Cc" header correctly, but didn’t actually send a copy. I reviewed SMTP.sendmail for hints and it seems that all recipients accept as one argument (it does not have a separate one to, ccand bcc).
Next I tried this:
headers = None
if form.cleaned_data['cc_sender']:
headers = {'Cc': sender}
recipients.append(sender)
msg = EmailMultiAlternatives(subject, message, sender, recipients, headers=headers)
msg.attach_alternative(replace(convert(message)), 'text/html')
msg.send(fail_silently=False)
This worked, but meant that when I click "reply" (anyway in Gmail), both addresses appear in the "To" field. I also tried setting the Reply-To header (before sender), but that didn't matter.
"cc" , . ?