I have a PHP script under a Wordpress theme sending emails using the mail() function.  I have postfix, dovecot and sendmail installed on the server.

Mails are not being sent from that script.  After a long wide search, the only lead I could find as to this error is this mail.log error I am getting from the php mail() execution:

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

I couldn't find any info as how to deal with it.  How can I resolve this?


Took me a few days but here's the solution:

It's in the mail section of /etc/php5/apache2/php.ini These configurations need to look like this:

[mail function]
SMTP = localhost
smtp_port = 25

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/sendmail -t
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.