django-allauth - 使用Gmail帐户发送电子邮件验证 [英] django-allauth - Send email verification using Gmail account

查看:196
本文介绍了django-allauth - 使用Gmail帐户发送电子邮件验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已设置allauth为每个新注册用户发送一封电子邮件,以便他们的电子邮件可以被验证。现在我使用email_backend,以便电子邮件发送到终端,而一切正常。

但是现在我想把它全部设置好,以便发送一封电子邮件,并且由于我将(可能)在主机服务器上没有本地电子邮件服务器,而是使用例如gmail帐户发送验证电子邮件。这是否可能?

解决方案

当然,您可以设置您的Gmail帐户发送电子邮件。只需设置django的这些设置即可:

  EMAIL_USE_TLS = True 
EMAIL_HOST ='smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = DEFAULT_FROM_EMAIL ='gmail账户'
EMAIL_HOST_PASSWORD ='gmail密码'


I have setup allauth to send out an email for every new registered user so that their email can be verified. Right now I use the email_backend so that the email is sent to the terminal instead, and everything works fine.

But now I want to can set it all up so that an email is sent, and since I will (likely) not have a local email server at the host server, but instead use for example an gmail account to send the verification email. Is this at all possible?

解决方案

Of course you can set your gmail account to send emails. Just set these settings for django:

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = DEFAULT_FROM_EMAIL = 'gmail account'
EMAIL_HOST_PASSWORD = 'gmail password'

这篇关于django-allauth - 使用Gmail帐户发送电子邮件验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆