On my VPS I use Ubuntu 16.04.2, Apache2 and PHP 7.0.15. Back when I installed the server environment I executed:

php-zip php-curl php-xml php-gd php7.0-mcrypt php7.0-mbstring -y apt-get install lamp-server^ -y

All of my sites on the server are Wordpress based and use the module Contact Form 7 and from some reason all contact forms in all these sites, don't work.

Whenever I go to try to send mail to throguh the forms, I get an "An error occurred".

So far, I understand this happens due to the PHP mail() function, malfunctioning in the server.

How could I make sure it's the mail() function and bring it back to life?

1 Answer 1


I was missing the postfix software which is a Mail Transfer Agent (receiver and sender of emails) in my environment.

I installed it this way: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.