Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

magic-removal: Fixed #1384 - ugly bug in mail_admins. Added additiona…

…l try blocks.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f9ed0eded9b5b5c5ea1b2ae3df84329dc8d05354 1 parent 04b22e5
Duncan Foster authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 django/core/mail.py
View
16 django/core/mail.py
@@ -43,9 +43,19 @@ def send_mass_mail(datatuple, fail_silently=False):
msg['Subject'] = subject
msg['From'] = from_email
msg['To'] = ', '.join(recipient_list)
- server.sendmail(from_email, recipient_list, msg.as_string())
- num_sent += 1
- server.quit()
+ try:
+ server.sendmail(from_email, recipient_list, msg.as_string())
+ num_sent += 1
+ except:
+ if fail_silently:
+ return
+ raise
+ try:
+ server.quit()
+ except:
+ if fail_silently:
+ return
+ raise
return num_sent
def mail_admins(subject, message, fail_silently=False):
Please sign in to comment.
Something went wrong with that request. Please try again.