Saturday, September 22, 2018

php - Mail Function was not working



Mail function was not working, but i am getting success message,but mail was not sent My code is following ,but this code working fine on another one server i can't identify the problem any solution for in this problem.........?



    include("conn.php");

if(isset($_REQUEST["mmailid"]))

{
$to=$_REQUEST["mmailid"];
$rs=mysql_query("select mmailid,mpass,mname from memtb where mmailid='$to'");

$rd1=mysql_num_rows($rs);
if($rd1>0)
{
$rd=mysql_fetch_array($rs);
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

$headers .= 'Bcc: itstephen34@gmail.com' . "\r\n";


$body="

stephen Logo

Dear " . $rd[2] . ",

    Your Password is : " . $rd[1] . " .

" . "

 

SUPPORT Team

CHANDRASTORE

";

ini_set("SMTP","localhost");
ini_set("sendmail_from","info@stephenraj.in");

$mail=mail($to,"Stephen Password Recovery MAIL",$body,$headers);
//mail($tomailid,"Stephen Registration Confirmation MAIL",$body,$headers);

if(isset($mail))
{
echo "Your Password Was Sent To Your Mail";
// echo $rd[2].$rd[1];
}
}
else
echo 'Invalid Mail ID'
}



?>

Answer



check with your hosting server..when ever we write a mail it will send through from our server first if your server to another doesn't have privilege or fire wall wont send.so check with your server hosting once


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...