I am having an issue trying to create an email verification link. I add the lin k in the body of the email, and when that url is visited, it verifies the emial using the parameters in the url. However, when the email is sent, it visits that link automatically, and verifies it. Does anyone know why it does this, or what I am doing wrong?
Here's my code
$to = $_POST['email'];
$subject = "";
$headers = "From: email@example.com" . "
";
$headers .= "Reply-To: email@example.com
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/html; charset=ISO-8859-1
";
$message = "<html><body><p>Here's a message</p>";
$message .= '<a href="http://www.example.com/verification.php?mv6e='.$encode.'&cv6v='.$verification.'">Click here to verify your application</a></body></html>';
mail($to, $subject, $message, $headers);
This should set a field in a database to "Verified". However, when the email is sent, the field is set to "Verified" before the user can even click on the link. Which gives me the impression that something is visiting the link beforehand. Any insight would be greatly appreciated.