Con razón con las prisas se me paso poner este codigo,
Código PHP:
function forgetpass($email,$code)
{
global $cp, $support_email, $site_name, $server_url, $code;
$msg="";
$sql="select * from users where email='$email'";
$result=mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
$pass=$row['password'];
$youname=$row['username'];
}
if($pass=="")
{
$msg="Dirección de correo electrónico proporcionada incorrecta .";
$id=1;
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
$code = rand(1111111111,9999999999);
$sql="UPDATE users SET code='$code' where email='$email'";
mysql_query($sql);
@mysql_close();
///Mail User
$subject = "Password reset confirmation";
$to = $email;
$from = $support_email;
$body= "Hello $uname, <br /><br />
We have received a request from IP address $ip to reset your account password. <br /><br /> To reset your password click the link below <br /><br /> $server_url/resetpassword.php?code=$code <br /><br /> If you didn't make this request just ignore this message. <br /><br /><br />-------------------------------------<br /> This is an automated E-mail from <br /> $site_name ";
$headers = "From: " . $from . "\n";
$headers .= "X-Sender: <" . "$to" . ">\n";
$headers .= "Return-Path: <" . "$to" . ">\n";
$headers .= "Error-To: <" . "$to" . ">\n";
$headers .= "Content-Type: text/html\n";
mail($to,$subject,$body,$headers);
$msg="Revisa tu Correo electrónico encontrara el email de Restablecimiento.";
$id=1;
}