Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Paul Robson
October 25, 2004, 7:04 pm
rate this thread
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
firstname.lastname@example.org (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 = "email@example.com";
$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>";