send email to bcc and cc in django
EmailMultiAlternatives
is a subclass of EmailMessage
. You can specify bcc
and cc
when you initialise the message.
msg = EmailMultiAlternatives(subject, text_content, from_email, [to_email], bcc=[bcc_email], cc=[cc_email])
EmailMessage
now supports cc
and bcc
:
https://docs.djangoproject.com/en/1.10/topics/email/#django.core.mail.EmailMessage
I needed bcc with HTML content as body and here is my implementation
from django.core.mail import EmailMessage
email = EmailMessage(
'Subject',
'htmlBody',
'[email protected]',
[[email protected]],
[[email protected]],
reply_to=['[email protected]']
)
email.content_subtype = "html"
email.send(fail_silently=True)
For more details refer Django docs