array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a file to write to ); $cwd = "c:\\csr\\membership\\bin\\"; $env = array(); $process = proc_open("test2.php", $descriptorspec, $pipes, $cwd, $env); if (is_resource($process)) { echo stream_get_contents($pipes[1]); echo stream_get_contents($pipes[2]); fclose($pipes[1]); fclose($pipes[2]); $return_value = proc_close($process); echo "command returned $return_value\n"; } ?> /*** C:\csr\membership\bin>test2.php Mail sent OK C:\csr\membership\bin>test.php Warning: mail(): Failed to connect to mailserver at "129.12.21.52" port 25, veri fy your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\csr\mem bership\bin\test2.php on line 2 Mail not sent command returned 0 ***/