PHP Mail send problem

The code given below is a ready to use script but can't send mail where should be the error i am sorry i do not understand php so much

$your_name = $_REQUEST['nametxt'];
$email = $_REQUEST['emailtxt'];
$message = $_REQUEST['messagetxt'];

$recipient_email = "";
$donotreply_email = "";
$me = "";
$me = "";

$subject = " message from " . $email;
//$headers = "From: " . $your_name . " <" . $email . ">\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1';

$content = "<html><head><title>Contact letter</title></head><body><br>";
$content .= "Name: <b>" . $your_name . "</b><br>";
$content .= "Email: <b>" . $email . "</b><br><hr><br>";
$content .= "Message: <b>" . $message . "</b><br>";
$content .= "<br></body></html>";

$forwardingthemessage = "$me

Has received the below message:

Name: $your_name
Email: $email




end of message";

$replymessage = "Hi $your_name

Thank you for your email.

We will follow up shortly.

Please DO NOT reply to this email.

Below is a copy of the message you submitted:
Name: $your_name
Email: $email

Best regards";

     "From: $email\nReply-To: $email");

     "Receipt from $me",
     "From: $donotreply_email\nReply-To: $donotreply_email");

<body bgcolor="#000000">
<div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

Your message was sent. Thank you.


<a href="javascript:history.back()"> <font color="FFFFFF"><---- Go Back</font> </a>

<!-- uncomment to resize the page -->	
<!-- <script>resizeTo(500, 500)</script> -->

Open in new window

Who is Participating?
Can you tell us what error comes up when you execute that script?

Also I would change:

"From: $donotreply_email\nReply-To: $donotreply_email");


"From: $donotreply_email");
Your syntax is perfect for the mail command.  Please add the following lines at the top of your page and then re-execute it:

error_reporting(E_ALL | E_STRICT);

This will hopefully give you an actual error message.  If you have root access to the server, you can also do "tail -f /var/log/maillog" when you send the message to see if it's actually attempting the send.  Also (as root) you can run the "mailq" command to see if any of your mails are queued due to some kind of global issue with sending on that machine.
Ray PaseurCommented:
Most PHP commands will give you a return value.  PHP mail() returns TRUE or FALSE.  You can test for this in your script and issue a diagnostic message.  But it is likely that the diagnostic message will not be visible unless you use "view source" because the HTML renders a black screen.  See line 89.
Mohamed AbowardaSoftware EngineerCommented:
Have you checked your Junk/Spam folder in your email to see if you have got the message there?
3XLcomAuthor Commented:
Thanks every body problem was safe mode. we resolve the issue kin regards
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.