0
votes

My question is basically the same as the question [here], but the asnwer given is not detailed enough. I want to have users submit an email address in a Google form. This email address will be used to periodically send emails to the people who have entered information. However, I don't want users to be able to enter a random email address to spam people. Therefore, I want to verify that the user has entered an email address belonging to themselves, similar to things such as adding a secondary email address in Gmail. I do not want to know how to check proper syntax.

To rephrase:
I want to verify that an email entered by a user belongs to that user.

1

1 Answers

0
votes

Generate a random verification ID

var charactersToUse = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
//Set the length of the ID number to generate.
var varLngthID = 5;
var makePubID = '';
for (var i=0; i<varLngthID; i++) {
  var randNum = Math.floor(Math.random() * charactersToUse.length);
  makePubID += charactersToUse.substring(randNum,randNum+1);
};

and send that number to the user in the initial email. Then when the user gets the email, they can come back to the site, and enter the verification code. If you want to check if an email is valid without sending an email to that address, that question has been asked here:

Stackoverflow check email without sending anything to it