How do I verify emails on a contact form? I want to implement a functionality where anonymous users can contact node authors. I have created a contact form with email field for each node. I would like to send an email verification link to the email address for email ownership confirmation. The form submit should be complete only when that happens.
What would be the best approach to handle this? There is a module in drupal 7 which could work but I didn't come across anything for D8. Will appreciate any help with this.
For validating an email just use client side validation in that case. mdn form validation
This will use the browsers checks for valid email and not send the form to you unless it’s valid.
For verifying an email I would say use Drupal accounts (that already has a superior methode for email verification.)
Btw. you can not check if email is valid at all.
The protocols involved do not allow a check like that.
What you can do is try and send a message and hope it arrives at the other end.
This would be a (as suggested) double take. But whether you are allowed to do so is another matter (it could be considered spam by local law). Safest bet is to either require an account or to to not validate it at all. (Possibly with a block list). And remember, do not make the cure worse that the disease. A mail validation could do that (quite a few sales people found that out)