diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index badd760..460c7d5 100644
|
a
|
b
|
class PasswordResetForm(forms.Form):
|
| 214 | 214 | Generates a one-use only link for resetting password and sends to the |
| 215 | 215 | user. |
| 216 | 216 | """ |
| 217 | | from django.core.mail import send_mail |
| | 217 | from django.core.mail import EmailMessage |
| 218 | 218 | for user in self.users_cache: |
| 219 | 219 | if not domain_override: |
| 220 | 220 | current_site = get_current_site(request) |
| … |
… |
class PasswordResetForm(forms.Form):
|
| 235 | 235 | # Email subject *must not* contain newlines |
| 236 | 236 | subject = ''.join(subject.splitlines()) |
| 237 | 237 | email = loader.render_to_string(email_template_name, c) |
| 238 | | send_mail(subject, email, from_email, [user.email]) |
| | 238 | EmailMessage(subject, email, from_email, [user.email]).send() |
| 239 | 239 | |
| 240 | 240 | |
| 241 | 241 | class SetPasswordForm(forms.Form): |
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py
index 571bf79..b0fdab9 100644
|
a
|
b
|
|
| 1 | 1 | import urllib |
| 2 | 2 | |
| 3 | 3 | from django.core.exceptions import ImproperlyConfigured |
| 4 | | from django.core.mail import send_mail |
| | 4 | from django.core.mail import EmailMessage |
| 5 | 5 | from django.db import models |
| 6 | 6 | from django.db.models.manager import EmptyManager |
| 7 | 7 | from django.utils.crypto import get_random_string |
| … |
… |
class User(models.Model):
|
| 363 | 363 | """ |
| 364 | 364 | Sends an email to this User. |
| 365 | 365 | """ |
| 366 | | send_mail(subject, message, from_email, [self.email]) |
| | 366 | EmailMessage(subject, message, from_email, [self.email]).send() |
| 367 | 367 | |
| 368 | 368 | def get_profile(self): |
| 369 | 369 | """ |