I try to build a newsletter application and want to send 50 emails with one connection. send_mass_mail() looks perfect but I can't figure out how I call this in combination with EmailMultiAlternatives.
This is my code that sends only one email with one connection:
html_content = render_to_string('newsletter.html', {'newsletter': n,})
text_content = "..."
msg = EmailMultiAlternatives("subject", text_content, "from@bla", ["to@bla"])
msg.attach_alternative(html_content, "text/html")
msg.send()
a working example with the code above and send_mass_mail would be great, thanks!