franck Posted September 9, 2006 Share Posted September 9, 2006 what's going on?? i have the next problem:I get this error when i try the function MAIL of PHP in localhost[color=red]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 D:\Mis Documentos\page.php on line 163Mail NOT Sent[/color]But when i tested in my website I get the message[color=red]"Mail Sent"[/color] but I don't receive anything in mail mail box or even junk mail box ... what is the problem???This is the code: [color=green] $to = '[email protected]'; $subject = 'busqueda de dominio'; $message = 'buscaron: '.$what.' en la web de serv'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if (mail($to, $subject, $message, $headers)) { echo 'Mail Sent'; } else { echo 'Mail NOT Sent'; }[/color]Please help me out I've been sitting around for 3 hours with this problem ... I have other email scripts and they all work fine ... so what's wrong with this one??Thanks ... later guys Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/ Share on other sites More sharing options...
redarrow Posted September 9, 2006 Share Posted September 9, 2006 this is a php.ini problam you have to setup the mail correctly ok. Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/#findComment-88866 Share on other sites More sharing options...
franck Posted September 9, 2006 Author Share Posted September 9, 2006 Nope ... php.ini is alright because this works fine[color=red] $headers = 'From: <' . $HTTP_POST_VARS["email"] . '>'; $body = "Formulario enviado\n"; $body .= "Nombre: " . $HTTP_POST_VARS["nombre"] . "\n"; $body .= "Email: " . $HTTP_POST_VARS["email"] . "\n"; $body .= "Consulta: " . $HTTP_POST_VARS["coment"] . "\n"; mail("[email protected]","Consulta",$body,$headers);[/color]But this doesn't work even thought i get the [color=orange]"Mail SENT"[/color] message[color=red]$to = '[email protected]'; $subject = 'busqueda de dominio'; $message = 'buscaron: '.$what.' en la web de serv'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if (mail($to, $subject, $message, $headers)) { echo 'Mail Sent'; } else { echo 'Mail NOT Sent'; }[/color]So there is nothing else to configured i guess.by the way I'm still getting this error message when i try this localhost:[color=red]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 D:\Mis Documentos\page.php on line 163Mail NOT Sent[/color] Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/#findComment-88956 Share on other sites More sharing options...
kenrbnsn Posted September 9, 2006 Share Posted September 9, 2006 This is what the manual says about the return status from the mail() function:[quote] Returns [b]TRUE[/b] if the mail was successfully accepted for delivery, [b]FALSE[/b] otherwise.It is important to note that just because the mail was accepted for delivery, it does [b]NOT[/b] mean the mail will actually reach the intended destination.[/quote]I assume you're getting the warning when your localhost is a window's machine. You need to set the SMTP parameters in the local PHP.INI file correctly. See http://www.php.net/manual/en/ref.mail.php for more information.Ken Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/#findComment-88958 Share on other sites More sharing options...
franck Posted September 16, 2006 Author Share Posted September 16, 2006 Thanks for all the help!!Now I'm through a long period of exams and i have to leave this project for the moment ... I hope you guys are still around, I might need a hand with the consults.Thank again. :D Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/#findComment-92849 Share on other sites More sharing options...
markbett Posted September 16, 2006 Share Posted September 16, 2006 check your mail server logs to see what happened to your email Link to comment https://forums.phpfreaks.com/topic/20203-i-get-this-understandable-error/#findComment-92859 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.