我尝试了很多网站,但我找不到我想做的结果。那么有人可以帮我解决这个问题吗?
我的问题是: 我想发送忘记密码的电子邮件给client.which会在15分钟后过期。这是我的代码
function send_email($to, $subject, $message) { global $from_email; global $from_pwd; global $host; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->ContentType = "text/html"; $mail->Host = $host; $mail->Port = 465; $mail->SMTPAuth = true; $mail->SMTPSecure = 'ssl'; $mail->Username = $from_email; $mail->Password = $from_pwd; $mail->From = $from_email; $mail->AddAddress($to); $mail->Subject = $subject; $mail->Body = $message; if(!$mail->Send()) { die('Message was not sent.'.$mail->ErrorInfo); } }
我还添加了此代码
//Send Welcome Email require_once("classes/class.phpmailer.php"); send_email($_POST["email"],"Thanks For Register", "Php Link is here");
答案 0 :(得分:2)
有很多方法可以达到这个目的: