title: How to send HttpResponse after email sent
body: <p>I try to send an email with django , its working fine but i want to send a HttpReponse or somthing like that after the email sent ,  is that possible to keep using thread for that ?</p>
  <pre><code>
  class EmailThread(threading.Thread):
      def __init__(self, subject, html_content, recipient_list, sender,name):
          self.subject = subject
          self.recipient_list = recipient_list
          self.html_content = html_content
          self.sender = sender
          threading.Thread.__init__(self)
          self.name= name
  
      def run(self):
          msg = EmailMessage(self.subject, self.html_content, self.sender, self.recipient_list)
          msg.attach_file('/tmp/{username}.{filename}'.format(username=self.name,filename='proformas')+ '.pdf')
          msg.content_subtype = &quot;html&quot;  # Main content is now text/html
          msg.encoding = 'utf-8'
          if(msg.send()):
              print('yes')
              return HttpResponse('SENT')
  
  
  
  def send_mail(request,pk):
      commande = get_object_or_404(Commande,id=pk)
      name  = commande.Client.Raison_social
      html_nadjib = render_to_string('Proformas/msg.html',{'raison_social':name,'Date':datetime.date.today()})
      to_emails = ['adzadadazda@outlook.com']
      subject = &quot;azdzadaz&quot;
      sender = 'aazdazdazadazdb@gmail.com'
      # EmailThread(subject, html_nadjib, to_emails, sender, name).start()
      if(EmailThread(subject, html_nadjib, to_emails, sender, name).start()):
       return HttpResponse('SENT')
      else:
          return HttpResponse('not sent')
  
  
  
  
  </code></pre>