Commits

offline committed f6c68c7

email now send html version

Comments (0)

Files changed (1)

openauth/utils.py

 from django.template.loader import get_template
 from django.core.urlresolvers import reverse
 from django.utils.encoding import smart_str
+from django.core.mail import EmailMessage
 from django.shortcuts import redirect
 from django.core.mail import send_mail
 from django.template import Context
 
     **kwargs may contain variables for template rendering.
     """
+
     subject, content = parse_template(template_path, **kwargs)
-    count = send_mail(subject, content, settings.DEFAULT_FROM_EMAIL,
-                      [rcpt], fail_silently=True)
-    return bool(count)
+    msg = EmailMessage(subject, content, settings.DEFAULT_FROM_EMAIL, [rcpt])
+    msg.content_subtype = "html"
+    return msg.send()
+
 
 
 def str_to_class(str):