I've just built a website for my company and have placed it on a server. It's working perfectly. The website contains a form page that collects request from staff. The form sends the information to the database. I placed code there for it to send a mail to my inbox so that I can be notified after a staff member fills the form. Unfortunately, the mail doesn't get to me. Please I need help on how to go about it.
I am using XAMPP at my back end. Below is the code that involves the mail part:
<?php
$to = "seyioyedeji31@yahoo.com";
$subject = "Test mail";
$message = "<html>
<head>
<title>MIS HELP SUCCESSFUL</title>
</head>
<body>
<p>Here are the query details:</p>
<p><table border=1 style= background:#0B0B61>
<tr><td> SENDER: $_POST[fullname]</td></tr>
<tr><td> DEPARTMENT: $_POST[department]</td></tr>
<tr><td> NATURE OF PROBLEM: $_POST[nature]</td></tr>
<tr><td> DETAILS: $_POST[mail]<td></tr>
</table></p>
</body>
</html>";
$from = "seyioyedeji@mis.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Mail could be broken at any number of points. Without knowing more, these are the points that come to mind:
Edit:
After a bit of looking, looks like this might be of help:
http://expertester.wordpress.com/2010/07/07/how-to-send-email-from-xampp-php/
which is based on another's solution from:
http://egrasp.wordpress.com/2010/02/03/sending-email-in-php-using-xampp-lite-1-7-3-on-windows/
But looks like XAMPP has its own special email sending configs. :)
If you want to configure XAMPP to deliver via localhost, you may need to install a local email service like postfix to handle outbound delivery, which is what I would normally do on a host. Though only have it listen on localhost to avoid abuse by spammers.
Normal localhost tests I would run:
uptime | mail you@email.address.com
# replace 'mail' with mailx, sendmail, etc. depending on what you have installed.
But that presumes you have a local mail handler installed.