Mail relay issue

Hi,

I’m new to the forum so please excuse any etiquette oversights on my part. I have searched the forum and googled to try to find an answer to my issue without much success: at least, nothing I’ve found is all the comprehensible and most related posts deal with a slightly different set of circumstances.

I have an Apache Webserver running PHP5 on a windows server box. There is no email server program on the webserver machine. Our organisation also has an SMTP server on a different machine. Both machines are on our lan and the SMTP server has been configured by our IS dept to permit relayed emails from the Webserver’s IP address, but not from any other external ip addresses.

However, when I attempt to send an email to a different domain (via a php script that uses the mail() function) I get an error message on the webserver that goes: [client 10.20.50.196] PHP Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for …
The same script works fine if the target email is hosted by the smtp server.

The mail function seems to be sending the mail to the smtp server with the ip address of my computer instead of using the ip address of the webserver itself. How can I change the behavior of php so that php scripts running mail() on my server can use the ip address of the webserver, not the client? Or am I going to be forced to install a mail server on my webserver or something? (looks tricky and I worry about not making it a target for spammers)

Thanks for any help you may offer! :slight_smile:

Ok, please ignore this post. The issue was resolved. Apparently someone forgot to change the smtp relay permissions after all. Sorry for the inconvenience.

Sponsor our Newsletter | Privacy Policy | Terms of Service