Problem with My code

I am hoping that some one can help me. I have a php login, everything works but the forget password retrieval. i keep getting this error;

"Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/47/7542447/html/Mentor/mentorlogin/email_password_sender.php on line 75 "

here is the code for the page

[php]include"master_inc.php";

$email = $_REQUEST[‘email’];

$sql=“SELECT * FROM users WHERE email=’$email’”;

$result=mysql_query($sql);

// Mysql_num_row is counting table rows

$count=mysql_num_rows($result);

//echo “count: $count
”;

// If result matches $myusername and $mypassword, table row must be 1 row

if($count==0){

die(“Sorry but we don’t have that email in our system. Please try again. Thank you!”);

}else{

//comes from config which pulls from /inc
$email_body = $forgot_password_email;

}

$from = $from_email;
$reply_to = $reply_to_email;
$return_path = $return_path_email;

$to = $email;

$subject = $forgot_password_email_subject;

//attaches view tracker to link tracked code - CCC
$mailbody= “$email_body”;

//____________________________Begin Multipart Mail Sender
//add From: header
$headers = “From:$from\nReply-to:$reply_to\nReturn-path:$return_path\nJobID:$date\n”;

//specify MIME version 1.0
$headers .= “MIME-Version: 1.0\n”;

//unique boundary
$boundary = uniqid(“HTMLDEMO8656856”);

//tell e-mail client this e-mail contains//alternate versions
$headers.=“X-Priority: 3\n”;
$headers.=“Content-Type: multipart/alternative; boundary=”".$boundary.""\n";
$headers.=“Content-Transfer-Encoding: 7bit\n”;

//message to people with clients who don’t
//understand MIME
$headers .= “This is a MIME encoded message.\n\n”;

//plain text version of message
$headers .= “–$boundary\n” .
“Content-Type: text/plain; charset=ISO-8859-1\r\n” .
“Content-Transfer-Encoding: base64\n\n”;
$headers .= chunk_split(base64_encode("$mailbody"));

//HTML version of message
$headers .= “–$boundary\n” .
“Content-Type: text/html; charset=ISO-8859-1\n” .
“Content-Transfer-Encoding: base64\n\n”;
$headers .= chunk_split(base64_encode("$mailbody"));

//---------- send message

if (mail("$to", “$subject”, “”, $headers))
{
echo"An account verification link has been sent to $email. This link will allow you to reset your password

Emails may take up to 10 minutes to arrive. Check your spam folder also and whitelist this site if you find our message there. Thanks!<br

Back to login";

}[/php]

the error is right after the send message comment and highlighted in red.

Moderator Edit: The send message comment is the one with lots of dashes placed before it. I placed the code into PHP tags which do not support the color tag inside of them. jSherz

i really hope some one can help me.

Thanks A Million
David Harvey

Hello notdaveharvey,
your passing wrong headers to mail function.
please check this http://php.net/manual/en/function.mail.php
I hope this will point you in right direction.
SR

Sponsor our Newsletter | Privacy Policy | Terms of Service