Question

PHP Mail on Virtual Hosts

Posted April 11, 2016 1.9k views
UbuntuPHPServer OptimizationGetting StartedEmailDigitalOceanConfiguration ManagementUbuntu 16.04

Morning,

I have read just about all of the tutorials and other questions in my search for help but none seem to do the trick.

I have set up a droplet and then created 2 virtual hosts, on one of my virtual hosts I have set up a bog standard HTML form with the requirement of having the content sent to me via the PHP mail function, however depsite trying a number of suggestions from other posts, nothing appears to be working and no e-mails are being sent by the server following submission of the form.

Droplet is Ubuntu 14.04, unsure what other pertinent information to supply.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello dear @daveoldacre, a quick way to check the error messages being to prepend the following lines to your problematic .php script:

error_reporting(E_ALL);
ini_set('display_errors', 1);

It may give you more clues as to what is the actual problem to debug.

If you find yourself stuck at debugging, please share the errors you get and I will personally help you debug so you can enjoy your droplet in full again.

Cheers!

Submit an Answer