I want to send emails to users when the forget their passwords that prompt them to reset their passwords. I know this is debatable and was looking for a few good options/suggestions/methods/articles to choose from.
I'm prompting users to press a 'forgot password' link with a simple script with the PHP portion doing this:
$Email = $_POST['email'];
$success = false;
$formError = false;
if(isset($_POST['sub_forgot_pw'])) {
if(empty($_POST['email'])) {
$formError = "true";
$error = "Please enter your e-mail address.";
}else{
$to = $Email;
$subject = "Password Help";
$message = "To reset your password, please <a href='http://www.blahblahblah.org'>Click here</a><br /><br />Do LIFE,<br /> The Team";
$from = "CysticLife <noreply@cysticlife.org>";
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= "From: $from";
if(mail($to, $subject, $message, $headers));{
$success = "true";
}
}
}