Tuesday, January 03, 2012

Send Email from the command line in Ubuntu 11.10

To have the ability to send email from the command line, you will need to install the mailutils and postfix packages with the following commands.
apt-get install mailutils
apt-get install postfix

Now configure Postfix by running the following command.
dpkg-reconfigure postfix

There will be several options on the main screen. For me, I selected "Internet Site" and used all of the default settings. You may want to play around with other options such as "Internet with smarthost."

After configuring Postfix, test out the new configuration with the following command.
echo "test" | mail me@mail.com

2 comments:

yifang said...

Did as your post, but nothing happened. No error, no email in my hotmail account. I must have missed something.
Can you provide more detail about the configuration. All the posts say it is easy by apt-get install and done! But I never got it work. Please give more detail. Thanks a lot!
Using ubuntu 11.10 compaq Presario CQ60 laptop.

tsengf said...

Can you check if your ISP is blocking port 25?