Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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\database\email.php on line 5

php.ini setting is as follows
[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 = you@yourdomain.com

I am use wampserver & windows xp.
Is there is need to change the setting of php.ini or any other solution.please help.
Thanks.
Posted
Updated 10-Jan-12 18:13pm
v3
Comments
Sergey Alexandrovich Kryukov 10-Jan-12 12:47pm    
Did you test SMTP on this host independently. How do you know it is properly installed and configured?
--SA
markkuk 11-Jan-12 9:11am    
Is your machine really running a SMTP server? Most likely you need to change the php.ini settings to point to a real mail server (for example your ISP).

1 solution

Hello friends,
My problem is solved.I use sendmail for sending email.
first download sendmail and keep it in wamp directory.The path of sendmail exe is set in php.ini file like sendmail_path="c:\wamp\...".
Now in php.ini file set ur smtp server name,port number,your gmail or any other mail id and save it.
Now in sendmail configuration file set following

smtp_server=smtp.gmail.com
smtp_port=25
auth_username=your mail id
auth_password=password
pop3_username=your mail id
pop3_password=password
force_sender=mail id.

save the changes and restart the server.
 
Share this answer
 

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