Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django EmailMultiAlternatives sending to multiple "to" addresses

Is there a way in Django EmailMultiAlternatives that you can send to multiple "to" addresses, without having to send it again?

Have tried separating the email int the tuple by commas, but only the first recipient receives the emails.

like image 464
ApPeL Avatar asked Nov 15 '25 12:11

ApPeL


1 Answers

A list of email addresses should work, as the example in the Django docs shows.

to_emails = ['[email protected]', '[email protected]']
msg = EmailMultiAlternatives(subject, text_content, from_email, to_emails)

You might want to use bcc instead of to_emails to prevent users from seeing the other recipients of the email.

msg = EmailMultiAlternatives(subject, text_content, from_email, bcc=to_emails)
like image 195
Alasdair Avatar answered Nov 18 '25 05:11

Alasdair



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!