<?php
$to = $_GET['email'];
$subject = "Password Rest";
$txt = "<html>
<head>
<title>SocialHub - Sign Up</title>
</head>
<body>
<div><table border='0' cellpadding='0' cellspacing='0' style='background-color:#3333ff;font-family:Sarala,sans-serif;color:#ffffff;border-collapse:collapse;margin:0;padding:0;background-color:#3333ff;font-family:Arial,Helvetica,sans-serif;width:100%' width='100%'>
    <tbody>
        <tr>
            <td align='center'>
            <div style='padding-top:25px;padding-bottom:10px;padding-left:5px;padding-right:5px;background-image:url(http://i.imgsafe.org/e8be26b.png);background-repeat:no-repeat;background-position:50% 50%;width:162px;min-height:41px;text-indent:100%;white-space:nowrap;overflow:hidden;border-collapse:collapse;margin:0;padding:0;background-color:#3333ff;width:100%;min-height:80px;max-height:80px;min-height:80px'>SocialHub</div>

				<h3 style='border-collapse:collapse;margin:0;padding:0;background-color:#3333ff;color:#ffffff;width:100%;font-family:Sarala,sans-serifalign:center;'>Password Reset</h3>
            </td>
        </tr>
    </tbody>
</table>

<div style='font-family:Sarala,sans-serif'>
<p style='padding-left:50px;padding-right:50px;padding-top:10px'>Your Password Was Reset To&#58; <b>" . $_GET['p'] . "</b><br><br>If Your Password Was Mistakenly Reset Please Go And Change Your Password <b>Immediately</b> at <a href='http://" . $_GET['ref'] . "/settings?err=1#password' style='text-decoration:none;' >http://" . $_GET['ref'] . "/settings</a></p>
</body>
</html>";
$headers = "From: SocialHub <no-reply@socialhub>" . "\r\n" .
"CC: " . $_GET['email'];
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

if(mail($to,$subject,$txt,$headers)){
header("location: http://" . $_GET['ref'] . "/forgot-password?sent");
} else {
header("location: http://" . $_GET['ref'] . "/forgot-password?sent=0");
}
?>