Skip to content

Instantly share code, notes, and snippets.

@savelee
Created July 10, 2015 14:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savelee/6701c707b8f5805c9cf7 to your computer and use it in GitHub Desktop.
Save savelee/6701c707b8f5805c9cf7 to your computer and use it in GitHub Desktop.
Setup php mail Ubuntu digital ocean
//login to your droplet.
//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
@cinghaman
Copy link

How do you output the hostname? what do you mean by hostname? the domain name u mean?

@harmandeep-singh
Copy link

harmandeep-singh commented Jul 8, 2019

@cinghamman

How do you output the hostname? what do you mean by hostname? the domain name u mean?

Hostname will be your domain name , in digital ocean it will return name of droplet : if you type on terminal "hostname"

@IgorUsoltsev
Copy link

Please, correct
//2. modify the hosts
nano /etc/host

on
//2. modify the hosts
nano /etc/hosts

@designscience
Copy link

Thanks for this. If php.ini sendmail_path has been modified and things still don't work try reverting sendmail_path to the default value or commenting that line out. Save php.ini then repeat $ sudo service apache2 restart .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment