0

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.........?

 <?php 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: [email protected]' . "\r\n"; $body="<table border=5 style='border-color:blue'><p><h3><img src='http://www.stephenraj.in/images/logo.jpg' alt='stephen Logo' /></h3></p><p>Dear " . $rd[2] . ",</p><p> &nbsp; &nbsp; Your Password is : " . $rd[1] . " .</p><p>" . "<p><h1>&nbsp;</h1></p><p>SUPPORT Team</p><p>CHANDRASTORE</p></table>"; ini_set("SMTP","localhost"); ini_set("sendmail_from","[email protected]"); $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' } ?> 
3
  • 2
    Security Note: don't send passwords in plain-text! Commented Mar 13, 2014 at 7:06
  • maybe this could help : <stackoverflow.com/questions/20297703/…> Commented Mar 13, 2014 at 7:09
  • Is the mail servre configured on your server side? Commented Mar 13, 2014 at 7:12

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

This seems to be the problem i faced a while ago. I discovered in my case that the problem was with the firewall of the server. I contacted the server admin and he did things right. Maybe this is the same problem you are facing.

1 Comment

Acyut : thanks for your suggestion i will be do that

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.