JavaScript verify email by SMTP

2019-09-19 14:41发布

问题:

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