I have problem with my php mailer was not Working & But token Was created.
Just showing msg 'Something Went to wrong'...Please Help me to Find Problem
My Code:
if(isset($_POST['action']) && $_POST['action'] == 'forgot'){
$email = $user->test_input($_POST['email']);
$user_found = $user->currentUser($email);
if($user_found != null){
$token = uniqid();
$token = str_shuffle($token);
$user->forgot_password($token,$email);
try{
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = Database::USERNAME;
$mail->Password = Database::PASSWORD;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom(Database::USERNAME,'HuntedZone');
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'Reset Password';
$mail->Body = '<h3>Click the Below link to reset your password.<br><a href="http://localhost/user-system/reset-pass.php?email='.$email.'&token='.$token.'">http://localhost/user-system/reset-pass.php?email='.$email.'&token='.$token.'</a><br>Regards<br>HuntedZone!</h3>';
$mail->send();
echo $user->showMessage('success','We Have send you the reset link in your e-mail ID, Please Check your e-mail');
}catch(Exception $e){
echo $user->showMessage('danger','Something went wrong Please try again Later!');
}
}else{
echo $user->showMessage('info','This E-mail is not Registered!');
}
}
question from:
https://stackoverflow.com/questions/65643949/phpmailer-function-issue 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…