$subject = 'Crypto-maniac - Forgotpass request'; // message $message = ' <html> <head> <title>Crypto-maniac - Forgotpass request</title> </head> <body> <h3>Hello ' . $username . '</h3> <p> You asked for a new password for your crypto-maniac account </p> <p> Please click on this <a href="' . $link . '"> reset link </a> for generate a new password</p> </body> </html> '; // Pour envoyer un mail HTML, l'en-tête Content-type doit être défini $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // En-têtes additionnels $headers .= 'To: ' . $username . ' <' . $mail . '>' . "\r\n"; $headers .= 'From: Crypto-maniac <*****@*****.**>' . "\r\n"; // Envoi if (mail($mail, $subject, $message, $headers)) { BaseDonnee::editKeyPassword($bdd, $username, $generatedKey); $_SESSION["success_forgotpass"] = "******"; } else { $_SESSION["erreur_forgotpass"] = "******"; } header("Location: ./forgotpass.php"); exit; } }