sendmail issues

Out of the box sendmail is a very simple MTA and significantly out of date.
People often suggest using Exim instead, as it’s much simpler to configure and you can use smart hosts for relaying mail.

Is sendmail installed?

Can you change directory to this?:

/usr/bin/sendmail

Installing sendmail

sudo apt-get install sendmail

Run Sendmail’s config and answer ‘Y’ to everything:

sudo sendmailconfig

Restart Apache:

sudo service apache2 restart

Configuring PHP to use sendmail

Open php.ini to editing

Ensure these lines are set:


[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25



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