from django.core.mail import EmailMultiAlternatives
subject, from_email, to = 'hello', 'from@example.com', 'to@example.com'
text_content = 'This is an important message.'
html_content = '<p>This is an <strong>important</strong> message.</p>'
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
I want to be able to sends newsletters or emails that have been designed properly, including images if possible. I was wondering if I could change this
html_content = '<p>This is an <strong>important</strong> message.</p>'
into an html template file. Like this
html_content = 'newsletter/news.html'
If not then how do I go about sending emails like that of Quora and other websites.`