cluce Posted May 7, 2007 Share Posted May 7, 2007 I am trying to send an email through a web form but I am getting an error...... I am trying to use windows xp on my local machine. 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:\wamp\www\sendmail.php on line 19 Can someone tell me how to fix this. Here are my config settings for the mail server..... [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. ;sendmail_from = me@localhost.com Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/ Share on other sites More sharing options...
Lumio Posted May 7, 2007 Share Posted May 7, 2007 Maybe your Mailserver isn't running Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-247591 Share on other sites More sharing options...
ToonMariner Posted May 7, 2007 Share Posted May 7, 2007 the smtp has to be set to your service providers server. I am on telewest so my php.ini files shows SMTP = smtp.blueyonder.co.uk Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-247594 Share on other sites More sharing options...
cluce Posted May 7, 2007 Author Share Posted May 7, 2007 well I am doing all my testing on the local machine using a localhost. My company email is @reaganpower.com but I am not using their email server for testing, I will only use my work email to recieve the message after submitted. So I am not sure if I am supposed to use my work email b/c I am not using their email server for testing that is all done on my local machine. Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-247604 Share on other sites More sharing options...
ToonMariner Posted May 7, 2007 Share Posted May 7, 2007 no use who ever provides your internet connection at home... they will have a mail server that you should use for outgoing messages. reply with your service provider and i will go look for the server you need Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-247687 Share on other sites More sharing options...
neel_basu Posted May 8, 2007 Share Posted May 8, 2007 To know whats the real fact you need to run the SMTP Commands in port 25 of that domain. to do it easily You can use this <?php $mail = new mail("admin@localhost", "Subject", "Mail Body"); //Just add a Simple hack here to show the SMTP conversation $mail->show_cnv = true; //3 Arguments Are Given //$mail = new mail("to@domain", "Mail Subject", "Mail Body"); if($mail->send()) { echo "Mail Sent Succfully\n"; } else { echo "Sorry Mail Sending Failed\n"; print_r($mail->error);//Print The Errors } ?> You will find the mail class here http://zigmoyd.sourceforge.net/man/mail.php PLease dont use the current version use the Previous version. But please see the Installetion and Instruction on this Page http://zigmoyd.sourceforge.net/man/index.php And if you dont wanna use this class use it for first time and see teh commands it sends and send those commands Manualy. Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-247824 Share on other sites More sharing options...
inyhir Posted February 24, 2013 Share Posted February 24, 2013 (edited) Holaaa!! a mi me salia el mismo error con WAMPSERVER y lo soluciones con el SQ SMTP Server 3,... tal como sale en el siguiente link: http://www.emagister.com/curso-apache-php-mysql-phpmyadmin-como-modulo-apache/instalacion-servidor-correo-smtp el correo me lo mando a SPAM. ... download SQ SMTP y siguiendo este codigo: <?php ini_set("SMTP","localhost");//Cambien mail.cantv.net Por localhost ... ojo, ojo OJO ini_set("smtp_port",25); ini_set("sendmail_from","turemitente@gmail.com"); $too = "xxxxx@yahoo.com" ;//pon tu correo para probar, your email $subject = "TEST" ; $message = "User message" ; $user_email = "xxxxxxxxxxx@gmail.com" ; // valid POST email address $headers = "From: $user_email " ; $headers .= "Reply-To: $too " ; $headers .= "Return-Path: $too " ; $headers .= "X-Mailer: PHP/" . phpversion (). " " ; $headers .= 'MIME-Version: 1.0' . " " ; $headers .= 'Content-type: text/html; UTF-8' . " " ; if( mail ( $too , $subject , $message , $headers )) echo 'SENT' ; ?> My php.ini is: ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 Edited February 24, 2013 by inyhir Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-1414716 Share on other sites More sharing options...
AyKay47 Posted February 24, 2013 Share Posted February 24, 2013 Holaaa!! a mi me salia el mismo error con WAMPSERVER y lo soluciones con el SQ SMTP Server 3,... tal como sale en el siguiente link: http://www.emagister...dor-correo-smtp el correo me lo mando a SPAM. ... download SQ SMTP y siguiendo este codigo: <?php ini_set("SMTP","localhost");//Cambien mail.cantv.net Por localhost ... ojo, ojo OJO ini_set("smtp_port",25); ini_set("sendmail_from","turemitente@gmail.com"); $too = "xxxxx@yahoo.com" ;//pon tu correo para probar, your email $subject = "TEST" ; $message = "User message" ; $user_email = "xxxxxxxxxxx@gmail.com" ; // valid POST email address $headers = "From: $user_email " ; $headers .= "Reply-To: $too " ; $headers .= "Return-Path: $too " ; $headers .= "X-Mailer: PHP/" . phpversion (). " " ; $headers .= 'MIME-Version: 1.0' . " " ; $headers .= 'Content-type: text/html; UTF-8' . " " ; if( mail ( $too , $subject , $message , $headers )) echo 'SENT' ; ?> My php.ini is: ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 Please start a new thread in english. Quote Link to comment https://forums.phpfreaks.com/topic/50409-failed-to-connect-to-mailserver-at-localhost-port-25-verify-your-smtp-and/#findComment-1414736 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.