shamuntoha Posted October 11, 2008 Share Posted October 11, 2008 Running windows 2003, Apache, PHP 5.0.3: why the following script showing not ok. What could be missing error or setup? php.ini: [mail function] ; For Win32 only. SMTP = anotherSMTP.domain.net smtp_port = 25 ; For Win32 only. sendmail_from = [email protected] cdoe: <?php if(mail([email protected]','test subject','test message')) { echo('ok'); }else{ echo('not ok'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/128012-solved-smtp-failure-need-to-have-a-loop-email/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 11, 2008 Share Posted October 11, 2008 Add the following two lines immediately after your first <?php tag to show any errors - ini_set ("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/128012-solved-smtp-failure-need-to-have-a-loop-email/#findComment-662856 Share on other sites More sharing options...
shamuntoha Posted October 11, 2008 Author Share Posted October 11, 2008 no error showing up, only showing "not ok". <?php if(mail('[email protected]','test subject','test message')) { echo('ok'); }else{ echo('not ok'); } ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> Quote Link to comment https://forums.phpfreaks.com/topic/128012-solved-smtp-failure-need-to-have-a-loop-email/#findComment-662881 Share on other sites More sharing options...
shamuntoha Posted October 11, 2008 Author Share Posted October 11, 2008 Ok getting as following: Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for [email protected] in C:\Inetpub\wwwroot\OTHERS\hbc\test.php on line 5 not ok no error showing up, only showing "not ok". <?php if(mail([email protected]','test subject','test message')) { echo('ok'); }else{ echo('not ok'); } ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> Quote Link to comment https://forums.phpfreaks.com/topic/128012-solved-smtp-failure-need-to-have-a-loop-email/#findComment-662883 Share on other sites More sharing options...
shamuntoha Posted October 11, 2008 Author Share Posted October 11, 2008 Thanks a big, Fixed, server issue not code problem. 1) Go to: start > settings > control panel > Administrative Tools > Internet Information Services 2) Expand the " (local computer)" node 3) Right click on your SMTP server > go to "Properties" 4) Click "Access" tab 5) Under Relay Restrictions, click the "Relay" button 6) Click "Add" 7) Select "Single Computer" and enter IP address 127.0.0.1 or public ip Hit OK, OK, OK (until the properties dialog is closed) Quote Link to comment https://forums.phpfreaks.com/topic/128012-solved-smtp-failure-need-to-have-a-loop-email/#findComment-662892 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.