send mail is freezing - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: send mail is freezing (/thread-35949.html) |
send mail is freezing - rwahdan - Jan-02-2022 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. 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() |