Click here to Skip to main content
16,018,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:\Program Files\wamp\www\classic\index.php on line 70


please can anyone help me

how to resolve this
and i used in mail function as
C#
mail($Email, 'Registration Confirmation', $message, 'From: munchchoudhry@gmail.com');
ini_set("SMTP","localhost");
ini_set("SMTP_PORT", 25);
ini_set("sendmail_from","munchchoudhry@gmail.com");



and in my php.ini file as
CSS
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = munchchoudhry@gmail.com



what is that mail server and what all changes to do
Posted
Comments
Sergey Alexandrovich Kryukov 16-Aug-12 3:36am    
OK. And do you really run a SMTP server at localhost? Did you test it?
--SA

1 solution

OK, the question is clear. For the first obvious step, make sure the SMTP server is really executing on the said host, which is localhost in your case. Did you test it independently? Without it, nothing can work, apparently. :-)

If you don't have this server, some suitable server running on some different host should work — you need to know and use one. If you do it and it does not help, please show your PHP code sample using mail.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900