Jump to content

[SOLVED] SMTP - failure. Need to have a loop email.


shamuntoha

Recommended Posts

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');   

}

?>

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);

 

?>

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);

 

?>

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

8) Hit OK, OK, OK (until the properties dialog is closed)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.