cerberus478 Posted October 27, 2011 Share Posted October 27, 2011 Hi I have a form that I want people to fill out and then click the button and it sends me an email. My problem is that it doesn't send me any emails, I have looked around and I don't seem to find any thing. This is my form in application_form.php <form action="application_form" method="POST"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td>Full name</td> <td><input type="text" size="30" maxlength="80" name="name" /></td> </tr> <tr> <td>Email address</td> <td><input type="text" size="30" maxlength="80" name="email" /></td> </tr> <tr> <td>Message</td> <td><textarea name="message" cols="29" rows="5"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="Submit Message" /></td> </tr> </table> </form> and this is the php on the same application_form.php <?php if (isset($_POST['submit'])) { // Collect variables $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; // Send email $body = "The following feedback has been submitted:\n\n"; $body .= "Name: $name\n"; $body .= "Email: $email\n"; $body .= "Message: $message"; mail ("[email protected]","Feedback Received",$body,"From: [email protected]"); // Output confirmation echo "<p>Your message has been received.</p>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/ Share on other sites More sharing options...
Network_ninja Posted October 27, 2011 Share Posted October 27, 2011 is there a mail server in your machine? eg. sendmail Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/#findComment-1282593 Share on other sites More sharing options...
cerberus478 Posted October 27, 2011 Author Share Posted October 27, 2011 i have outlook Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/#findComment-1282594 Share on other sites More sharing options...
Network_ninja Posted October 27, 2011 Share Posted October 27, 2011 is your server a windows? I also encounter that kind of problem but we are running in linux environment and sendmail is built in to it, we just need to configure it a bit. Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/#findComment-1282595 Share on other sites More sharing options...
cerberus478 Posted October 27, 2011 Author Share Posted October 27, 2011 yes it's windows Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/#findComment-1282596 Share on other sites More sharing options...
cerberus478 Posted October 27, 2011 Author Share Posted October 27, 2011 I solved it I had to put -f [email protected] after [email protected] Quote Link to comment https://forums.phpfreaks.com/topic/249888-how-to-send-email/#findComment-1282600 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.