For what it’s worth, I pulled some code from the ’net to change the above test script to this and saw that both email approaches worked, but I ded not get an email when selecting "Forgot Password" as noted above. Test script :
<?php
/**
* test php default mailer
*/
ini_set('display_errors', true);
$to = '[email protected]';
$subj = 'test subject';
$msg = 'test message';
$result = mail($to, $subj, $msg);
$yn = $result ? 'Yes' : 'No';
echo "Mail sent via 'mail'? $yn\n";
$fd = popen("/usr/sbin/sendmail -t","w") or die("Couldn't Open Sendmail");
fputs($fd, "To: [email protected] \n");
fputs($fd, "From: \"You1\" <[email protected]> \n");
fputs($fd, "Subject: Test message from my web site \n");
fputs($fd, "X-Mailer: PHP5 \n\n");
fputs($fd, "Testing. \n");
pclose($fd);
echo "Mail sent via sendmail okay\n";
?>
If I have a php.ini file with
sendmail_path = /usr/sbin/sendmail -t -i
I get an error dialog box saying "Error sending email [...]"
If I have a php.ini file with
sendmail_path = /usr/sbin/sendmail -t -i -nYourCompanyName
I get a message saying to check my inbox. But nothing arrives. I suspect it’s failing and it’s not getting caught?
The thing I still cannot figure out is that I have this working on another site where the MODx install is in a subfolder and has it’s own php.ini file. I cannot figure out what the difference is in the setup. Time to call Bluehost, I guess.
Other details :
FireFox 3.6.3
MODx Evo 1.0.3
PHP Version 5.2.13
MySQL 5.1.46
host = Bluehost
Finally, the goal of this is to get a "friendly" "From" field as seen in the second approach in the test script above. If there’s another way I can do that instead of messing with a php.ini file, that would be one less thing there is to screw up.
TIA,
Matt