Problems with mail()

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm just tinkering with PHP and learning the basics ; all well and good
so far, except I can't get mail() to work.

I'm running Apache 2 & PHP 4.3.9, and ssmtp on Gentoo. ssmtp is set up
correctly (I can use "sendmail" in evolution fine).

When I post from PHP it seems to work ok except it's emailed to (according to my log). I've tried setting
the sendmail directory option in php.ini to /usr/lib/sendmail & that
doesn't work either..... I'm mystified.

Am I doing something obviously wrong ?
Any ideas ?


    $msg = "Name: $_POST[name]\n";
    $msg .= "E-Mail: $_POST[email]\n";
    $msg .= "Message: $_POST[message]\n";
    $recipient = "";
    $subject = "Form submission results";
    $mailheaders = "Reply-To: $_POST[email]";
    $mailheaders = "";    // this line in or out makes no odds ....
    mail($recipient,$subject,$msg,$mailheaders) or die("Failed to send");
    print "Message sent successfully.<br>";

Re: Problems with mail()

Quoted text here. Click to load it


Site Timeline