一 配置mysite/mysite/settings.py
# 邮件发送到控制台,而不发送到实际的邮箱
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
二 测试
1 输入要发送的电子邮件
2 点击发送电子邮件
3 控制台显示
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[23/Dec/2018 15:03:39] "GET /account/password-reset/ HTTP/1.1" 200 2081
[23/Dec/2018 15:03:40] "GET /blog/ HTTP/1.1" 200 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: =?utf-8?b?6K+36YeN572u5L2g55qE5a+G56CB77yB?=
From: 798103175@qq.com
To: 798