so i tried this first. every thing works and get a message echo"message successfully, sent".
but when i check my email nothing comes.
//$email is the user email
$to = $email;
$subject = "Forgot password";
$message = "Hi $firstname_db,\n Your password is $password_db";
$headers = "from: text@hotmail.com";
if(mail($to, $subject, $message, $headers)) //lline 49
{
echo "message successfully sent";
}
else
{
echo "failed";
}
so i tried different method but still no luck.
$to = $email;
$subject = "Forgot password";
$message = "Hi $firstname_db,\n Your password is $password_db";
$header = "From: text@hotmail.com";
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
$header_ = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/plain; charset=UTF-8' . "\r\n" .
'Content-Transfer-Encoding: base64' . "\r\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', base64_encode($message), $header_ . $header);
}