maryum Posted November 19, 2008 Share Posted November 19, 2008 hello 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" can any one help me thnx Link to comment https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/ Share on other sites More sharing options...
ratcateme Posted November 19, 2008 Share Posted November 19, 2008 do you have a mail server running? you need to turn on mercury in your xampp control panel. Scott. Link to comment https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/#findComment-693289 Share on other sites More sharing options...
maryum Posted November 19, 2008 Author Share Posted November 19, 2008 if i tutrn it on than papche services stop, i have reinstalled it but the problem remains there Link to comment https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/#findComment-693292 Share on other sites More sharing options...
ratcateme Posted November 19, 2008 Share Posted November 19, 2008 try this forum to get the problem with xampp sorted then you should be able to send mail http://www.apachefriends.org/f/viewforum.php?f=16 Scott. Link to comment https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/#findComment-693294 Share on other sites More sharing options...
maryum Posted November 19, 2008 Author Share Posted November 19, 2008 i'll chek it out thnx Link to comment https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/#findComment-693297 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.