I wrote a progamm in php to send mail using the mail() function and got the message

"Warning: 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\easyphp1-7\www\spinyo\homepage.php on line 18
"
I checked the php.ini file and the smtp is configured to localhost but can't find the smtp_port configurations.What should I do to enable this configuration

Comments

mukeshrasm’s picture

use
ini_set('smtp_port',25);

it should work. or check the port using echo php_info(); to know your port.

mray’s picture

"echo php_info();" seems to be wrong. Use:
"echo phpinfo();"