1827894 Members
1936 Online
109969 Solutions
New Discussion

PHP & email

 
Sandy_11
Occasional Contributor

PHP & email

I want to ask the question about sending email in php.
But it does not function well
and display the error:
Warning: mail() is not supported in this PHP build in /usr/local/apache_1.3.22/htdocs/interface/mailtest.php on line 13


Is it there is something command I need to set?? Then I don't know what is the command and where to carry out??

and is it if i want to use php code to send email, is it just simply write down the following code:

mail("email@address", "Subject", "content");
?>

then when the user access those php will automatically send email????


Thanks a lot
3 REPLIES 3
Josh Owings
Frequent Advisor

Re: PHP & email

What version of PHP are you running? The example line seems to work fine on my box running PHP/4.0.4.
Maybe you should just try upgrading.

Re: PHP & email

Most of the mail configuration is done in the php.ini file. Depending on your platform, you may have the path to sendmail wrong or smtp problems. It's all under the '[mail function]' block in the php.ini file. I know that the "sendmail_from=" parameter in this block gave me trouble in the past. SMTP servers don't like to forward mail from 'me@localhost.com', or at least they shouldn't, but that's a different topic...

I hope this helps, and don't forget about points...

~Chris
Sandy_11
Occasional Contributor

Re: PHP & email

but I cannot find the php.ini in the server
and I just find only php.ini-dist and php.ini-optimized

And then what should I do??