Report this

What is the reason for this report?

Mail not sending on Ubuntu Server.

Posted on March 6, 2014

I’m fairly new to Digital Ocean, and recently set up a droplet, that I attached a domain to. The contact page of the website is in php format. I’ve tested the contact form on another server. It works just fine on that server, but not on the Ubuntu server/droplet I made for the website. PHP is installed, and the page displays properly, but I’m wondering if I need to install a certain PHP module? So far I’ve installed: php5-snmp, php5-imap & php5-cgi. Afterwards, I restarted apache so that all of the changes would take effect, but I received the following message : “apache2: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName”. So then I went into my etc/apache2/httpd.conf file and added the line : ServerName localhost . The contact form still doesn’t work on the server.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi! <br> <br>Do you have any smtp server configured on this droplet, like sendmail or postfix? I thing the mail() funcion need this, or need an external smtp server configuration on php.ini.

Hello all,

Our new disabled-by-default SMTP policy goes into effect from June 22, 2022, for all new accounts

https://www.digitalocean.com/blog/smtp-restricted-by-default

You can use a third-party mail provider like SendGrid in order to avoid issues like this one. SendGrid is available as a one-click application from our marketplace. You can quickly spin up a droplet that is ready to use.

You can find more information here:

https://marketplace.digitalocean.com/apps/sendgrid

I’ll also recommend checking this article:

https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.