Jump to content

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


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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.