I was having trouble getting my mail php mail script to work yesterday but I finally got it going. Now I just turned my computer back on after a shutdown and its not working again. I am getting this message in my mail.log:
Oct 1 11:22:26 alexander-repennings-imac postfix/sendmail[352]: fatal: Recipient addresses must be specifie\
d on the command line or via the -t option
Oct 1 11:22:26 alexander-repennings-imac postfix/master[354]: daemon started — version 2.4.3, configuratio\
n /etc/postfix
Oct 1 11:23:26 alexander-repennings-imac postfix/master[354]: master exit time has arrived
The PHP script looks like this:
<?php
if(isset($_POST['submit'])) {
$to = "MichaelMinerva2012@gmail.com";
$subject = "Competition Submission";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$value_field = $_POST['sendvalue'];
$body = "From: $name_field\n E-Mail: $email_field\n Value: $value_field\n";
if(mail($to, $subject, $body))
echo "Data has been submitted to $to!";
else
echo "failure";
} else {
echo "blarg!";
}
?>
Which is once again echoing failure.
probably the sendmail_path value isn’t set in php.ini. Open it to see if the following line is uncommented*
Worked for me once.
*assuming you are running on Unix system