Hello!
We have solved the problem.... The problem wasn't in the php nor itn the server configuration, but the Exchange itself... The Open relay, as it is called, allows scripts to run from the other machines too, but if you close that, the only place, that will allow you execute the server scripts, is the server itself, or not even that...
The open relay must be set for the servver machine to mail function to work, I couldn't find other solutions...
Hope to help. Bye!