PHP Mail Problem
-
I am using PHP mail functionality to send mail whenever a user submits the feedback on a post.
The codes are something like this :
<?php
$headers = ‘From: [email protected]’.”\r\n” .
‘CC: [email protected]’.”\r\n”.
‘Reply-To:$_REQUEST[‘contactemail’]’.”\r\n”;if ($_REQUEST[‘contactemail’]){
mail($to, ‘Response to somedomain.com Ad’, $body.$editlink,$headers);
mail($_REQUEST[‘contactemail’], ‘Response to somedomain.com Ad’, $client_tag.$body, $headers);
}else{
echo'<h2>You seem to have entered an invalid e-mail address. Please try again.’;
}
?>When i am using email address in Reply-To: [email protected] it works but when i use $_REQUEST[‘contactemail’] , it gives an error which is as follows: Parse error: syntax error, unexpected T_STRING in runtime.php(42):eval()’d code on line 24.
LIne 24 is: $headers = ‘From: [email protected]’.”\r\n” .
‘CC: [email protected]’.”\r\n”.
‘Reply-To:$_REQUEST[‘contactemail’]’.”\r\n”;Please suggest how o resolve this issue.
Thanks
Dipak
- The topic ‘PHP Mail Problem’ is closed to new replies.