cyjetsu Posted September 5, 2008 Share Posted September 5, 2008 I have setup a basic php and html form on my local virtualhost(apache). When I click submit button I get 2 errors: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\operator1\on-infosol\primary\contact\form.php on line 6 Warning: Cannot modify header information - headers already sent by (output started at C:\operator1\on-infosol\primary\contact\form.php:6) in C:\operator1\on-infosol\primary\contact\form.php on line 7 This is the html code. <form action="form.php" method="POST"> <table> <tr> <td>Name:</td> <td><input type="text" name="name"></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="email"></td> </tr> <tr> <td>Message:</td> <td><textarea name="mesg"></textarea></td> </tr> <tr> <td><input type="submit" name="SubmitForm" value="Send"></td> </tr> </table> </form> and this is php code inside form.php: <?php $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "myaccount@hotmail.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.example.com/thankyou.html" ); ?> Do I need to install some kind of program to send mail from on my local apache server? Or is a standard apache installation capable of doing so.... how? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 5, 2008 Share Posted September 5, 2008 There is a BIG and STICKY topic in this forum dealing with your problem. Find it here. PS: The function.mail error is due to not having configured a stmp server. 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.