Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed postfix and when trying to send mail, I get the followig error:-

fatal: Recipient addresses must be specified on the command line or via the -t option

The code I used to send mail is this:-

<?php
$to      = 'myemail@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

$x = mail($to, $subject, $message, $headers);
var_dump($x);
?>

Can anyone point out what is wrong?

share|improve this question
2  
What's in the mail section of your php.ini file? It looks like PHP<->mail is misconfigured on this machine. It looks like a -t is missing. –  David Schwartz Feb 20 '12 at 4:13
    
What is the output of grep sendmail php.ini ? –  adamo Feb 20 '12 at 6:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.