Server Sendmail
Installation of sendmail in the server droplet / machine
This guide is focus more on Linux OS
Firstly, install Sendmail using the command:
$ sudo apt-get install sendmail
Now configure /etc/hosts file. To find the hostname, use the command:
$ hostname
Then type the command:
$ sudo nano /etc/hosts
On the line starting with 127.0.0.1, add the hostname to the end so it looks the same as:
$ 127.0.0.1 localhost hostname
Now press Ctrl+x, then βYβ to save and exit.
Run Sendmailβs config and answer βYβ to everything
$ sudo sendmailconfig
Now restart Apache with the command:
$ sudo service apache2 restart
πCongrats!, your server can now send an email using our recruit application.
You can use the following instructions to send email using the sendmail command:
$ sendmail email_address < file.txt
For example, I have created a file
file.txt
with the following text:Hello there !
The command for sending the message will be:
$ sendmail < file.txt james@example.com

You can use -s option to specify the email subject.
Reference: https://www.digitalocean.com/community/tutorials/send-email-linux-command-line
Last updated