Skip to content

Instantly share code, notes, and snippets.

@mrts
Created May 29, 2017 20:14
Show Gist options
  • Select an option

  • Save mrts/039a9764bf4d23cda1bdac564cd0dfc4 to your computer and use it in GitHub Desktop.

Select an option

Save mrts/039a9764bf4d23cda1bdac564cd0dfc4 to your computer and use it in GitHub Desktop.
Send mail with Django so that recipients don't see other recipients
from django.core.mail import send_mass_mail
subject = 'test subject'
message = 'test message'
from_email = '[email protected]'
recipient_list = ['[email protected]', '[email protected]', '[email protected]']
messages = [(subject, message, from_email, [recipient]) for recipient in recipient_list]
send_mass_mail(messages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment