Facing problem with sending email using PHP. Please help as soon as possible...?

  • Thread starter Thread starter sHuVo
  • Start date Start date
S

sHuVo

Guest
I have written this piece of code:

<?php

$post=$_POST['send'];
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$from = $_POST['from'];
$headers = "From:www.nothing.com";

if (mail($to, $subject, $message, $headers, $from)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

?>



Shows this error message:

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:\xampp\htdocs\shuvosspace\birthdays.php on line 14



Please helpppp
 
Post your question on citytechforum.com, offer small reward and someone will help you.

John
 
Post your question on citytechforum.com, offer small reward and someone will help you.

John
 
Back
Top