Monday, 22 July 2013

Send email from command line using Ubuntu 12.04

To send email from command line in Ubuntu the best command line which can be used is
mutt. But this does not come pre-installed in the system so you may have to add it.

Please do the following in the command prompt (shell) of  your system.

1) sudo apt-get install mutt
2) Once the installation is complete you will have to add the normal user with
   mail priviledges using the following command line.
   sudo adduser <your username> mail
3) Once this is done you will be able to send mail via command line.
   using either of th following commands.
   a) echo test | mutt -s <subject of mail> email-id
   b) cat <file-name>  | mutt -s <subject of mail> email-id
in case a the mail content will be test an in case b) it will the content written in
file <file-name>

Hope you have enjoyed the post
rzm

No comments:

Post a Comment