failed to connect mail server
Posted: 19. November 2008 10:41
hi
i m trying to send mail through php the code is given below
"
<?php
ini_set("SMTP", "127.0.0.1");
ini_set("smtp_port", 25);
$to = $_POST['to'];
$from = $_POST['from'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$header = "MIME version: 1.0\r\n";
$header .= "Conttent-type:text/html;charset=ISO-8859-1\r\n";
$header .= "From:$from \r\n";
$header .= "Cc: $cc \r\n";
$header .= "Bcc: $bcc \r\n";
$header .= "Reply-to: <$from>\r\n";
$header .= "X-Mailer: PHP/".phpversion();
ini_set("SMTP", "127.0.0.1");
ini_set("smtp_port", 25);
mail($to, $subject, $body, $header);
?>"
but following error occours
"Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\xampp\htdocs\mailing\srvrsendmail.php on line 19"
and if i try to turn on the mercury services, apache services stop.
can any one help me
thnx
i m trying to send mail through php the code is given below
"
<?php
ini_set("SMTP", "127.0.0.1");
ini_set("smtp_port", 25);
$to = $_POST['to'];
$from = $_POST['from'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$header = "MIME version: 1.0\r\n";
$header .= "Conttent-type:text/html;charset=ISO-8859-1\r\n";
$header .= "From:$from \r\n";
$header .= "Cc: $cc \r\n";
$header .= "Bcc: $bcc \r\n";
$header .= "Reply-to: <$from>\r\n";
$header .= "X-Mailer: PHP/".phpversion();
ini_set("SMTP", "127.0.0.1");
ini_set("smtp_port", 25);
mail($to, $subject, $body, $header);
?>"
but following error occours
"Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\xampp\htdocs\mailing\srvrsendmail.php on line 19"
and if i try to turn on the mercury services, apache services stop.
can any one help me
thnx