Here is the error message I get:
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 E:\Users\DartStudents\kleinj2\jfk430\catering.php on line 10
We encountered an error sending your mail
Here is my html form file:
<form method="post" action="catering.php">
Email: <input name="email" type="text"><br>
Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input type="submit">
</form>
Here is my php file:
<?php
$to = "[email protected]";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
What's wrong?
I'm not sure where I add this "# telnet locahost 25"
I am new to php.
All of the websites I look at give basically the same code, tell you to copy and paste it, change a few things and then post it to your server and try it out. I am posting it to an ftp server that runs cold fusion just fine? Don't understand what is wrong.
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 E:\Users\DartStudents\kleinj2\jfk430\catering.php on line 10
We encountered an error sending your mail
Here is my html form file:
<form method="post" action="catering.php">
Email: <input name="email" type="text"><br>
Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input type="submit">
</form>
Here is my php file:
<?php
$to = "[email protected]";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
What's wrong?
I'm not sure where I add this "# telnet locahost 25"
I am new to php.
All of the websites I look at give basically the same code, tell you to copy and paste it, change a few things and then post it to your server and try it out. I am posting it to an ftp server that runs cold fusion just fine? Don't understand what is wrong.