如何检查给定的电子邮件地址是否存在于python中 [英] How to check whether a given email address exists or not in python

查看:442
本文介绍了如何检查给定的电子邮件地址是否存在于python中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python和django的新手,并不太了解它在SMTP或MX Records等的实现。我已经在Django做了一个网站,我需要存储用户输入的有效和验证的电子邮件地址。没有向用户的电子邮件地址发送任何激活或确认电子邮件,我如何检查电子邮件地址是否存在?

解决方案

你不行验证电子邮件的唯一方法(可靠地)是向其发送电子邮件。



除此之外,只有检查电子邮件地址是否存在是一个可怕的想法,因为它允许任何人签署任何地址到您的系统。您应该只接受用户对您发送的电子邮件进行验证的地址(例如,激活链接)。


I am new to python and django and don't know much about its implementation in SMTP or MX Records etc. I have made a website in Django and I need to store the valid and verified email address entered by the user. Without sending any activation or confirmation email to the user's email address, how can i check whether the email address exists or not?

解决方案

You can't. The only way to verify the email exists (reliably) is to send an email to it.

Beyond that, it's a terrible idea to only check if the email address exists, as it allows anyone to sign any address up to your system. You should only accept addresses that have been verified by the user actioning the email you send them (for example, an activation link).

这篇关于如何检查给定的电子邮件地址是否存在于python中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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