Setup the PHP mail() function on a Ubuntu server
1 min readJan 3, 2019
I’ve got a DigitalOcean server running Ubuntu 18 with Apache and PHP 7.2. I wanted to be able to send emails from it using the PHP mail()
function and WordPress plugins like GravityForms and such.
After a lot of googling, I stumbled upon the excellent and very easy guide below. Only three steps where required to make it work:
sudo apt-get install sendmail
sudo sendmailconfig
(answer Yes to everything)sudo service apache2 restart