//sending link to the email of the user $to = '$users email'; $subject = 'Password reset'; $from = 'example@example.com'; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Create email headers $headers .= 'From: '.$from."\r\n". 'Reply-To: '.$from."\r\n" . 'X-Mailer: PHP/' . phpversion(); // Compose a simple HTML email message $message = '<html><body>'; $message .= '<p>Dear user <br> We received a password reset request for your account</p>'; $message .= '<p>Please click on the link to reset your password and pleease remember that after a certain period of time, the link will expire. <br> If you did not make this password reset request please ignore this email and your password will not be changed </p>'; $message .= '</body></html>'; // Sending email if(mail($to, $subject, $message, $headers)){ echo 'Your mail has been sent successfully.'; } else{ echo 'Unable to send email. Please try again.'; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)