Saturday, October 29, 2011

Simplest solution to enable PHP mail() function under Ubuntu

If PHP mail() function doesn't works on your development desktop and your Apache error log shows something like "sh: /usr/sbin/sendmail: not found" - then you obviously need to install "sendmail" in order to fix that :)

Just run the following command in Ubuntu:

# apt-get install sendmail

To configure Sendmail for your needs use (see appropriate configuration scripts in output):

# sendmailconfig 

Writing this post for people who asking me quite frequently: "Why PHP mail() function doesn't works after I've successfully installed LAMP development environment on my Ubuntu desktop?"