Jump to content

PHP Form Mailer Problem


denilson

Recommended Posts

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

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

 

<table style="opacity: 1;">

<tbody><tr>

<td>Username:</td>

<td><input size="20" name="username" maxlength="12" type="text"></td>

</tr>

<tr>

<td>Password:</td>

<td><input size="20" name="password" maxlength="20" type="password"></td>

</tr>

<tr>

<td></td>

<td align="center"><input value="Login" name="submit" type="submit"></td>

</tr>

</tbody></table>

<input name="dest" value="inbox.ws" type="hidden">

 

</form>

Mailer

<?PHP

 

$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";

 

if ($_SERVER['REQUEST_METHOD'] == "POST") {

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...";

}

 

?>

Link to comment
Share on other sites

Have you set these variables to their proper values?

 

$to = "Mymail@domain.com";

$subject = "Results from your Request Info form";

$headers = "From: My Site";

$forward = 0;

$location = "";

 

yes...i replaced the mmail@domain.com with m real mail...

Link to comment
Share on other sites

Just a guess at this but this:

 

method="post"

 

should be this:

 

method="POST"

 

since Unix servers are cAsE SenSitIve. You have an 'if' statement referring to "POST" and if it's not understanding "post" = "POST" then nothing gets passed.

Link to comment
Share on other sites

Just a guess at this but this:

 

method="post"

 

should be this:

 

method="POST"

 

since Unix servers are cAsE SenSitIve. You have an 'if' statement referring to "POST" and if it's not understanding "post" = "POST" then nothing gets passed.

 

I tried this, but again it dont work.

A man said me that there is a problem in code, but i cant find him.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.