sudo apt-get install postfix
sudo touch etc/php5/conf.d/mailconfig.ini

Then add these line in mailconfig.ini

sendmail_from = [email protected]
sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]

Lastly, restart postfix service.

sudo /etc/init.d/postfix start