Django在控制台显示发送邮件内容

一 配置mysite/mysite/settings.py

# 邮件发送到控制台,而不发送到实际的邮箱
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

二 测试

1 输入要发送的电子邮件

Django在控制台显示发送邮件内容_第1张图片

2 点击发送电子邮件

Django在控制台显示发送邮件内容_第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: [email protected]
To: [email protected]
Date: Sun, 23 Dec 2018 07:03:47 -0000
Message-ID: <20181223070347.50632.37976@DESKTOP-5SDKDG4>

因为你在 CSDN重置了密码,所以你收到了这封邮件!

请转到以下页面,选择一个新密码:

http://localhost:8000/account/password-reset-confirm/NQ/52d-cd55925d659f35856c1b/

你的用户名是:test

感谢您使用我们的网站!

https://blog.csdn.net/chengqiuming/

------------------------------------------------------------------------------- [23/Dec/2018 15:03:47] "POST /account/password-reset/ HTTP/1.1" 302 0 [23/Dec/2018 15:03:47] "GET /account/password-reset-done HTTP/1.1" 301 0 [23/Dec/2018 15:03:48] "GET /account/password-reset-done/ HTTP/1.1" 200 1757

 

你可能感兴趣的:(Django)