I have a script that submits form data using PHP and sendmail on a Linux machine, and the script works well. However, I copied the script to an OS X machine and I have run into problems. The page loads without errrors and the webserver (WebStar 5) shows no errors, but the email that should be sent never reaches the mail server.
Sendmail is installed, and I turned it on in the hostconfig file.
I added the correct directory in the php.ini file, though I was confused about WebStar 5 moving this file to within its own cgi-bin directory. Nonetheless the php.ini file works because changes take effect in php after a restart. My php.ini file currently lists "sendmail_path = /usr/sbin/sendmail -t -i", and this is consistent with the actual location of sendmail.
Multiple forms submit through this page, so depending on which form is dumping into this page, there may be a number of undefined variables listed in the $msg string. This was ignored on my linux box, does anyone know if this is a problem in OS X?
Is it possible to monitor how my requests are being processed by sendmail in the Terminal?
I am grateful for any ideas anyone may have to get this to work. Thanks much. A synopsis of the code related to the mail() command is given below.
$to = "app@company.org";
$sub = "OFR";
$msg = "PHPSESSID: ".$Reason."\nREFURL: ".$REFURL." ";
$frm = "From: admin@company.org";
if($EMail != "")mail($to, $sub, $msg, $frm);