Cannot Send Mail

October 15, 2013 4.2k views
Hey all, Last night I set up a Droplet with the LAMP stack on Ubuntu 12.04. My sites are all moved over and everything seems to be working fine, with the exception of mail. My contact form no longer sends mail. I did some Googling and all of the threads I've found on the Digital Ocean board haven't worked. I don't need to receive mail, simply send it, so hopefully someone can lend a hand. I've tried postfix, sendmail, exim4, and nothing works.
5 Answers
What's the contact form invoking to send mail? are you missing a PHP module?
are you connected to the internet?
Do you have an SPF record? If so, you may need to add your droplet's IP address to it. Check out SPF Wizard.

Also, make sure that your WordPress permissions are www-data:www-data. What's the output of ls -la /path/to/WordPress/root/directory/?
Check the mail log.

```
tail -f /etc/mail.err
```

I'm having the same issue and it's because the www-data user doesn't have permission to send email. Haven't found the solution yet.
The issue for me was that the sendmail path needs to be set in the php.ini file.
Have another answer? Share your knowledge.