login to your droplet of digital ocean

  1. output the hostname hostname

  2. modify the hosts nano /etc/host

  3. the first line in this file, should use the hostname on the end. For example: “Lee” 127.0.0.1 localhost localhost.domainname Lee

  4. install mail sudo apt-get install sendmail

  5. configure the mail, answer yes to everything: sudo sendmailconfig

  6. Restart apache2 sudo service apache2 restart

Prevent the spam folder

  1. Make sure your IP address is not on a blacklist. http://mxtoolbox.com/blacklists.aspx

  2. Make sure the SPF record is set properly in a TXT record of the DNS for your domain: “v=spf1 +a +mx +ip4:xx.xx.xx.xx ~all”

  3. Make sure that the DKIM record is set properly in a TXT record of the DNS for your domain: “v=DKIM1; k=rsa; p=some.very.long.rsa.key.goes.here\;

  4. Make sure your server is not an open relay