Does it execute correctly from the command line if run as user "apache"?
That would be the first thing I would check. Likely a permissions issue.
Our apache runs as httpd. If I su httpd then run the file I both get an
email and have the variables written out to the text file.
Since my original email I also tried to send an email with a perl
script with the same results: an email sent from the command line and
nothing when executed with mod security. I also tried to run the perl
script both through mod sec and as the httpd user with the same results as the php file.
We don't run sendmail, we run qmail with the sendmail replacement, not sure if this matters.
Ultimately the script will do much more than send an email, but I figure that's a good place to start.
(resending this because i didn't hit reply to all)