Friday, October 9, 2015

How to send email through terminal in ubuntu?

Send email through terminal in ubuntu:

Hi everybody,

In this blog we will cover email sending through terminal in ubuntu.

1. For send a email through terminal firstly install the postfix using this

sudo apt-get install postfix
 
2. Now go to this file

sudo nano /etc/postfix/main.cf

and change

myhostname = example.com

3. Put in name of your domain into myhostname.

4. If you want to have mail forwarded to other domains, replace alias_maps with virtual_alias_maps and point it to /etc/postfix/virtual.

virtual_alias_maps = hash:/etc/postfix/virtual

5. The rest of the lines are set by default. Save, exit, and reload the configuration file to put your changes into effect:

sudo /etc/init.d/postfix reload

6. Now run this for checking through terminal

sendmail sample-email@example.org

No comments:

Post a Comment