Skip to content

Commit

Permalink
magic-removal: Fixed #1384 - ugly bug in mail_admins. Added additiona…
Browse files Browse the repository at this point in the history
…l try blocks.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
Duncan Foster committed Feb 28, 2006
1 parent 04b22e5 commit f9ed0ed
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions django/core/mail.py
Expand Up @@ -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):
Expand Down

0 comments on commit f9ed0ed

Please sign in to comment.