offline avatar offline committed f6c68c7

email now send html version

Comments (0)

Files changed (1)


 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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.