The command mail works perfectly.(Lets do the conventional bottom posting and keep this on the list).
What sorts of php things can I investigate?
e On Feb 23, 2004, at 1:40 PM, Chris Hewitt wrote:
Elijah A. Chancey wrote:
Can a normal user send mail via which means?Yes, all users on a unix box should be able to send email. From a prompt:
e On Feb 23, 2004, at 11:35 AM, Chris Hewitt wrote:
Elijah A. Chancey wrote:
I'm having difficulty with the php mail() function. Freebsd 4.9, apache 2.0.48, php 4.3.4Can a normal user send email? If so then it is a php problem, if not a sendmail one. I think that will help to narrow it down a bit.
Here is my code:
<?php mail("[EMAIL PROTECTED]", "subject", "body"); ?>
The problem: The mail is not being delivered to my address. PHP returns no errors.
HTH Chris
mail -s "mysubject" [EMAIL PROTECTED] <filewithmessage
will do it. Do a "man mail" for more information. It will use whatever email system you have set up on the computer, thus it is a good test to see where email may be going wrong. When you have email going from a normal user OK then its time to check from php again.
HTH
Chris
You can check in php.ini for the "sendmail_path" option being uncommented, and set to something suitable, commonly:
sendmail_path = /usr/bin/sendmail -t -i
You could also just check by pointing a browser at a phpinfo() file that the php.ini that you are checking is where PHP is looking for it.
I have not used the newer sendmails with submit.mc, I use sendmail here but all emails are sent to my ISP's email server which I have configured as the smart_host. This is not likely to be a problem for you as an ordinary user can send email.
I don't use the inbuilt mail command in PHP, but a more flexible wrapper class from php-classes.org so I can only assume that your PHP mail command syntax is OK. Other than the above, I can't think of anything to go wrong.
HTH Chris PS I've got to go now, be around in the morning.