  from email.MIMEText import MIMEText
  from email.Header import Header
  from email.Utils import formatdate
  import smtplib
  import socket
  import time
  import random
  
  # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
 
</s> remove # Use this module for e-mailing.
 </s> add """
Tools for sending email.
""" </s> remove     return send_mass_mail([[subject, message, from_email, recipient_list]], fail_silently, auth_user, auth_password)
 </s> add     connection = SMTPConnection(username=auth_user, password=auth_password,
                                 fail_silently=fail_silently)
    return EmailMessage(subject, message, from_email, recipient_list, connection=connection).send() </s> remove     send_mail(settings.EMAIL_SUBJECT_PREFIX + subject, message, settings.SERVER_EMAIL, [a[1] for a in settings.ADMINS], fail_silently)
 </s> add     EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
            settings.SERVER_EMAIL, [a[1] for a in
                settings.ADMINS]).send(fail_silently=fail_silently) </s> remove     send_mail(settings.EMAIL_SUBJECT_PREFIX + subject, message, settings.SERVER_EMAIL, [a[1] for a in settings.MANAGERS], fail_silently)
 </s> add     EmailMessage(settings.EMAIL_SUBJECT_PREFIX + subject, message,
            settings.SERVER_EMAIL, [a[1] for a in
                settings.MANAGERS]).send(fail_silently=fail_silently)

import os
  from email.MIMEText import MIMEText
  from email.Header import Header
  from email.Utils import formatdate
import os
  import smtplib
  import socket
  import time
  import random
  
  # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
keep keep add keep keep keep keep keep keep
 Fixed #3366 -- Part 1 of the email code refactoring and feature extension. This
part refactors email sending into a more object-oriented interface in order to
make adding new features possible without making the API unusable. Thanks to
Gary Wilson for doing the design thinking and initial coding on this.

Includes documentation addition, but it probably needs a rewrite/edit, since
I'm not very happy with it at the moment.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5141 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/mail.py