JavaScript verify email by SMTP

微笑、不失礼 提交于 2020-01-26 04:21:06

问题


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.

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.

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

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.


回答1:


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



来源:https://stackoverflow.com/questions/12174029/javascript-verify-email-by-smtp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!