Jump to content

php form error


cyjetsu

Recommended Posts

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( "[email protected]", "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?

Link to comment
https://forums.phpfreaks.com/topic/122941-php-form-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.