[Fixed]-Django EmailMessage send() works and then gives HTTP Error 400: Bad Request

1👍

✅

You should use msg.send(fail_silently = True) to send emails without failing to send mail to a bogus or invalid email id.

For both views with email sending functionality,use it like this :

message = get_template('...../email_template.html').render(Context(ctx))
msg = EmailMessage(subject, message, from_email=from_email, to=[email_address], bcc=recipient_list)
msg.content_subtype = 'html'
msg.send(fail_silently = True)

Leave a comment