Jump to content

Check for existant email?


Fritz_Doll

Recommended Posts

function EmailValidation($email) {  	$email = htmlspecialchars(stripslashes(strip_tags($email))); //parse unnecessary characters to prevent exploits 	 	if ( eregi ( '[a-z||0-9]@[a-z||0-9].[a-z]', $email ) ) { //checks to make sure the email address is in a valid format 	$domain = explode( "@", $email ); //get the domain name 		 		if ( @fsockopen ($domain[1],80,$errno,$errstr,3)) { 			//if the connection can be established, the email address is probabley valid 			return true; 			/* 			 			GENERATE A VERIFICATION EMAIL 			 			*/ 			 		} else { 			return false; //if a connection cannot be established return false 		} 	 	} else { 		return false; //if email address is an invalid format return false 	} }

Found this with google...

Link to comment
Share on other sites

all it does is verify that the domain exists, not the email.an example $email was "flargleinglelop@yahoo.com" <- i know the domain exists.I also went to yahoo and went to the sign up form, "flargleinglelop@yahoo.com" is available to take.however the script outputs True, which is wrong.

Link to comment
Share on other sites

What about if someone uses personal domain which is not in your script. For example user@w3schools.com How will you check then? Don't bother yourself with it.

Link to comment
Share on other sites

So, just take their word that they are submitting a valid address? I guess I could, It's for account validation and password recovery. I'll just put a flag on their account until they validate their email (They'll just have some trouble getting their password back if it isn't valid).

Link to comment
Share on other sites

You could send a confirmation email... that's how this forum does it - send a unique email with a link they must go to. When the unique URL is accessed, assume it came from the email and mark it as existant.

Link to comment
Share on other sites

If you are doing this for a login, then Boen_robot's suggestion is the best. Many login systems these days are dependent upon a valid email address. You could automatically generate a password, then send it to that email address. If the individual signing up knows this, then they'll will most likely enter a valid address.

Link to comment
Share on other sites

So just assume it exists, then verify that it exists if I get a response. I'll try that.
i guess. Force them to prove to you its real, by having the user follow up with a confirmation email.
Link to comment
Share on other sites

I like that suggestion, generate a password. If they log in with the password I give them, then I'll change their password to what they had desired. Thanks for the suggestions!
Passwords, I though this was about emails? Regardless after they login, or authorize, or whatever, just set a flag in their profile in the DB somewhere from false to true, or from inactive, to active, or something like that, to confirm their email is authentic.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...