Page 1 of 1

failed to connect mail server

PostPosted: 19. November 2008 10:41
by maryum
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

Re: failed to connect mail server

PostPosted: 19. November 2008 10:52
by Sharley
maryum wrote:...and if i try to turn on the mercury services, apache services stop...
Look in the MercuryMail configurations find and disable the MercuryMail web server or change the port to other than 80, then you will be able to run both MercuryMail and the Apache server - doing this does not effect MercuryMail sending and receiving mail.

MercuryMail by default uses port 80 for a server which must be disabled to use Apache, who also wants to use port 80 which = conflict.

PostPosted: 19. November 2008 11:03
by maryum
thnx a lot u solved my prob

PostPosted: 19. November 2008 11:22
by elwizard
Thank you Sharley. This helped to me too.