Jan-02-2022, 09:06 AM
Hi
I am trying to send an email but it is freezing and if i refresh the page everything is working except for the email part, it is not sent.
I am trying to send an email but it is freezing and if i refresh the page everything is working except for the email part, it is not sent.
from django.core.mail import EmailMessage from django.conf import settings from django.template.loader import render_to_string template = render_to_string('cart/email_template.html', {'name': request.user.profile.username}) the_email = EmailMessage( 'Thanks for your purchase!', template, settings.EMAIL_HOST_USER, [request.user.profile.email], ) the_email.fail_silently = False the_email.content_subtype = 'html' the_email.send()