利用变量记录信息
$From="From: $dbemail";
$To="$dbemail";
$Subject="Your user record password:\n";
$Content="$user: your password is $dbpw for zjliu intranet.\n";
利用mail发送邮件
$sendpw=mail($To,$Subject,$Content,$From);
判断是否发送成功
if($sendpw)
{
echo "Your password has been sent out to $dbemail<br>";
}
else
{
echo "Your password can not be sent out to $dbemail, please check your intput!<br>";
}
$From="From: $dbemail";
$To="$dbemail";
$Subject="Your user record password:\n";
$Content="$user: your password is $dbpw for zjliu intranet.\n";
利用mail发送邮件
$sendpw=mail($To,$Subject,$Content,$From);
判断是否发送成功
if($sendpw)
{
echo "Your password has been sent out to $dbemail<br>";
}
else
{
echo "Your password can not be sent out to $dbemail, please check your intput!<br>";
}
本文介绍了一种使用PHP脚本实现密码重置邮件发送的方法。通过设置邮件的发件人、收件人、主题及内容,并调用mail()函数完成发送过程。最后验证邮件是否发送成功并给出相应提示。
521

被折叠的 条评论
为什么被折叠?



