php mail() send to outside addresses

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have successfully setup my php.ini file on a web server to
communicate with my Microsoft Exchange Mail server, and can test the
ability to send mail using the mail() function to internet mail
addresses. (mailboxes on our network),

However, when attempting to send mail to an outside address (ex:
someone at gmail dot com) the mail() returns "failed".

Here's my setup.
Windows 2003 IIs 6.0 webserver
Windows 2003 box running Exchange 2003

Is it a change I need to make to php.ini to allow mail to outside e-
mail domains? Is it a setting I need to change within Exchange? Or is
it simply a limitation of mail() to not be able to send mail to
outside domains?

Greatly appreciate your responses!


Re: php mail() send to outside addresses

xx75vulcan wrote:
Quoted text here. Click to load it


No problem from the PHP end itself - I send mail to outside domains all  
the time.  It'd be rather pointless if you couldn't, wouldn't it?

Rather, your MTA is probably set up to not be an open relay - which  
would make your server invaluable to spammers (for a few hours, at least  
- until you get blacklisted).

You need to first understand your Exchange configuration.  Depending on  
how its set up determines what you need to do from the PHP end.

I suggest you start with an Exchange newsgroup.  I doubt many people  
here will be able to help you with Exchange configuration.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: php mail() send to outside addresses

Quoted text here. Click to load it

Jerry is correct.  Well, on all but that last part, anyway :)

You need to configure your Exchange server to allow relaying from a
specific machine (like your webserver) or specific networks (like you
internal network).  In the Exchange System Manager, find the SMTP
Virtual server and open the properties for it.  On the "Access" tab
click on "Relay" and add the IP address of your webserver.  If you
trust your entire local network you could add that, too.  Just make
sure you have it set to allow relay for "only the list below" -- not
"all except the list below."

Site Timeline