Copy link to clipboard
Copied
Can any one see wha't worng here.
This piece of code should return the users password by email but the email arrives successfully without any password.
The email is sucessfully passed as $_POST['email'] as it is used as the email address for the email sent so something else msut be wrong>
Any ideas?
***********************************
$email = $_POST['email'] ;
$sql = mysql_query("SELECT email, password FROM users where email = '$email'")
or die(mysql_error());
$row = mysql_fetch_array($sql);
$rownum = mysql_num_rows($sql);
$to= $row['email'];
$subject= "Your login details";
if(!$rownum ) {
echo "<H3>Sorry, that email address does not match our records</H3>";
}
if($rownum ==1 ){
$message .= "Your password is:\n\n".$row['password']."\n\n
To sign-in click here http://www.mysite.com/admin/sign-in.php";
$header = "From: support@mysite.com.com";
$sent = mail($to,$subject,$message,$header);
if($sent)
{
print "<H3>Your password has been sent to your e mail address</H3>" ;
}
}
***********************************
Copy link to clipboard
Copied
Show us what the contents of the email actually look like.
>$message .= "Your password is:\n\n".$row['password']."\n\n
Looks like you're missing the closing double quote.
Copy link to clipboard
Copied
Are you seeing "Your password has been sent to your e mail address" message?
It can be a lot of things.
Some servers (recipient side) will accept emails with proper headers only.
You are sending the email as user "nobody". Your server might be set to prevent to send emails as nobody which requires you to send it via SMTP connection.(you can ask your host about this)
Copy link to clipboard
Copied
Burak, the OP mentioned that the email arrives, but the content is not as expected. So it sounds like something malformed in the $message string.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more