Fedexpress Posted October 21, 2008 Share Posted October 21, 2008 Dear Sir/Mam , Actually I am unable to send mail using php5 , i have enlisted the configurations of php.ini later . I surfed a bit and downloaded a Free SMTP Server but I am completely clueless as to how use it This is the c :-*nfiguration in php.ini file [mail function] ; For Win32 only. SMTP = smtp.my.server.net smtp_port = 25 ; For Win32 only. sendmail_from = user@somesite.net This is the c :(de : <?php $to = "avinash_singh_as@yahoo.com"; $subject = "Hello"; $message = "This is a test message!"; $headers = "FROM: user@somesite.net"; if (mail($to, $subject, $message,$headers)) { echo "Message sent!"; } else { echo "Message sending failed."; } ?> This is the error message : ???Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.my.server.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8 :'(Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8 Any suggestions on what should be done , and Do i have any ioption of using the Free SMTP server that i Have downloaded. Thanks a Lot!! Quote Link to comment https://forums.phpfreaks.com/topic/129447-problem-sending-e-mail-using-php5/ Share on other sites More sharing options...
MadTechie Posted October 21, 2008 Share Posted October 21, 2008 Okay First Error ???Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.my.server.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8 I assume your mail domain isn't smtp.my.server.net.. But if you installed "Free SMTP Server" (which i have never used before) on the same PC then your localhost is your SMTP Server.. so in the PHP.INI change SMTP = smtp.my.server.net to SMTP = localhost The other errors may be related so lets resolve one at a time.. you may need to restart your PHP server after the change.. but "Free SMTP Server" should be running (do it have a test option?) Last be not least this isn't really a PHP question.. Quote Link to comment https://forums.phpfreaks.com/topic/129447-problem-sending-e-mail-using-php5/#findComment-671117 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.