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

Many folks have been getting the error message sending email using php’s mail() function on Fedora, Red Hat Enterprise and Centos boxes, possible many others.


This error usually happens if you are using Postfix or Sendmail MTA. The error shows up in the maillog file as follows:

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

You can fix this problem by editing sendmail_path value in php.ini file and commenting the following line (possible, making the changes to it as shown below)

sendmail_path = /usr/sbin/sendmail -t

Restart Apache and see if it works. It does for me ;)


Comments

  1. Jeff says:

    Some folks may benefit by using

    sendmail_path = /usr/sbin/sendmail -t -i

    as well. Feel free to test it out.

  2. code says:

    I was confused just by this error!!
    Thank you for your describing.

    I came to this page from Japan by Google.

  3. drew says:

    thank you fixed my problem

    sendmail_path = /opt/zimbra/postfix/sbin/sendmail -t -i

  4. Bruce says:

    I was confused just by this error!!
    Thank you for your describing.

    I came to this page from Japan by Google.

  5. pib says:

    A million thanks!

Leave a Reply