1. Waldemar Kornewald
  2. djangoappengine


Gregory Haskins  committed 344fca1

Pass the fail_silently kwd to deferred mail sender so it may ignore errors (and
not spawn new error emails).

  • Participants
  • Parent commits 9689b94
  • Branches mailfix

Comments (0)

Files changed (1)

File mail.py

View file
  • Ignore whitespace
 from django.core.exceptions import ImproperlyConfigured
 from google.appengine.api import mail as aeemail
-def _send_deferred(message):
-    message.send()
+def _send_deferred(message, fail_silently=False):
+    try:
+        message.send()
+    except aeemail.Error:
+        if not fail_silently:
+            raise
 class EmailBackend(BaseEmailBackend):
     can_defer = False
     def _defer_message(self, message):
         from google.appengine.ext import deferred
-        deferred.defer(_send_deferred, message)
+        deferred.defer(_send_deferred, message, fail_silently=self.fail_silently)
 class AsyncEmailBackend(EmailBackend):
     can_defer = True