Member Lost Password

$user->ID,
‘user_pass’ => $random_password
)
);

// if update user return true then lets send user an email containing the new password
if( $update_user ) {
$to = $email;
$subject = ‘Your new password’;
$sender = get_option(‘name’);

$message = ‘Your new CCRC web site password is: ‘.$random_password;

$headers[] = ‘MIME-Version: 1.0’ . “\r\n”;
$headers[] = ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
$headers[] = “X-Mailer: PHP \r\n”;
$headers[] = ‘From: ‘.$sender.’ < '.$email.'>‘ . “\r\n”;

$mail = wp_mail( $to, $subject, $message, $headers );
if( $mail )
$success = ‘Check your email address for your new password.’;

} else {
$error = ‘Oops something went wrong updating your account.’;
}

}

if( ! empty( $error ) )
echo ‘

ERROR: ‘. $error .’

‘;

if( ! empty( $success ) )
echo ‘

‘; header( “refresh:5; url=members” );
}
?>

Please enter your username or email address. You will receive a link to create a new password via email.