JavaScript通过SMTP验证电子邮件 [英] JavaScript verify email by SMTP

查看:251
本文介绍了JavaScript通过SMTP验证电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想启用我的网站表单,以检查我的访问者插入的电子邮件是否有效,并在允许他们提交网络表单之前存在。

I would like to enable my website form to check if the email inserted by my visitor is valid and exist before allowing them submit the web form.

我明白有很多Javascript来检查电子邮件模式验证。但是我需要SMTP邮件检查或验证的东西。

I do understand there is many Javascript to check the email pattern validation. But I need something such as SMTP Email Checking or Validating.

访问者插入的电子邮件必须是有效的格式,也是存在的,这是为了防止访客插入无效的电子邮件,不正确电子邮件地址以及垃圾邮件地址。

The email inserted by visitor must be valid format and also existed, this is to prevent visitor inserts invalid email, incorrect email address, as well as spamming email address.

请提供使用Javascript验证电子邮件的教程链接。

Please kindly provide a tutorial link for validate the Email by using Javascript.

我认为服务器端脚本可以做到这一点,但是我需要在Web访问者选择提交按钮以提交表单之前立即响应Web表单。

I believe server-side scripting can doing it, but I need an instant response to the web form before web visitor select the submit button for form submission.

推荐答案

没有确定您的用户是否拥有该电子邮件帐户,电子邮件是否有效是没有意义的。因此,确认电子邮件地址的唯一方法是有效的,实际上该用户拥有的是向他们发送验证电子邮件。

There is no point just checking if an email is "valid" without confirming that your user "owns" that email account. So therefore the only way to confirm an email address is valid AND is actually owned by that user is to send them a verification email.

在您的电子邮件中,您将包括一个唯一的代码,并存储在数据库中。

In your email you'll include a unique code, and store that in the database.

然后在电子邮件中,让他们点击您的网站的链接,验证唯一的代码。这可以让您确认电子邮件地址。

Then in the email get them to click on the link to your website where you validate the unique code. This allows you to confirm the email address.

一旦用户确认了他们的电子邮件地址,然后让他们登录您的网站

Once the user has confirmed their email address - then let them login into your site

这篇关于JavaScript通过SMTP验证电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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