Forum Moderators: bakedjake
I have tried various methods to send the mail from PHP, starting with the basic mail() function, and now I've tried using sendmail.
The code is basically:
1 $fp = popen('/path/to/sendmail -t','w');
2 fputs($fp,"To: $to\n");
3 fputs($fp,"From: $from\n");
4 fputs($fp,"Subject: $subject\n\n");
5 fputs($fp,"$body");
6 pclose($fp);
This returns no errors in PHP, but no mail is sent. I've checked that a file handler is returned on line 1, and characters are written on lines 2 to 5.
I don't know too much about chroot but I understand that problems such as this can arise i.e. modules are not copied across to the new environment and so cannot be accessed.
What I don't understand is why a virtually identical script using perl in the same environment actually send mails.
Can anybody enlighten me as to what the problem might be?