php - PHPMailer 函数问题
问题描述
我的 php 邮件程序有问题,但无法正常工作,但已创建令牌。只是显示味精'出了点问题'......请帮我找出问题我的代码:
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!');
}
}
解决方案
推荐阅读
- python-3.x - 正则化 l1 逻辑回归特征选择在重新运行时返回不同的 coef_
- python - 根据索引/列名将小矩阵中的值添加到更大的矩阵中
- apache-flink - 更改“Kinesis Data Analytics for Apache Flink”应用程序的 CloudWatch 日志输出
- r - 在代码中添加 scale_fill_brewer() 会导致绘图值发生变化?
- r - 使用 r 根据另一列中的值编辑字符串值
- .net - 通过 IIS 服务器的负载平衡器访问时出现 Kerberos 身份验证问题
- java - 在 Windows 10 中为 java 项目运行 maven 构建时,cygwin 在控制台输出中引入空格
- reactjs - getStaticPaths Next JS 中未定义的路径
- python - 使用 while 循环重复程序失败
- html - “float:left;”有问题 在做井字游戏的时候?