• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

Bash: mail: command not found (CentOS, Redhat, Ubuntu and Debian)

Written by Rahul, Updated on November 24, 2017

With the minimum installation of any Linux operating system, you will not see most of the commands in your system. In minimum operating system installation only required packages are installed for running an operating system and skipped unnecessary packages. mail command is useful for sending emails from Linux command line which is used for almost Linux operating system. Most of Debian based systems will show error like “The program ‘mail’ is currently not installed. You can install it by typing”

There are many other alternatives to mail command for sending emails from Linux command line interface. Visit here for more options.

Install mail Command:

Let’s use one of below command to install mail command as per your operating system. For RHEL based systems, this command installed from mailx rpm packages and on Debian based system this command found in mailutils package.

Install mail command on CentOS/Redhat 7/6/5:

yum install mailx

Install mail command on Fedora 22+:

dnf install mailx

Install mail command on Ubuntu/Debian/LinuxMint:

sudo apt-get install mailutils

Sending Test Email

After installing mail command packages in your system, send a test email using below command.

echo "Message Body" | mail -s "Message Subject" [email protected]

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

5 Comments

  1. Avatar Subodh Reply
    October 18, 2020 at 1:46 pm

    Hi Rahul,

    I have installed AMAZON ec2-instance on which I have installed Postfix email service.

    I am not able to send emails using Postfix.

    Can you help?

  2. Avatar Noah Reply
    March 28, 2018 at 2:47 pm

    I installed the package, and it’s asking for a “postfix configuration.” I can’t select anything. Help!

    • Avatar Noah Reply
      March 28, 2018 at 2:47 pm

      Never mind. I solved it.

  3. Avatar bharath Reply
    September 8, 2017 at 12:38 pm

    hi,
    i am not able to send mail with non root user

    • Avatar Elias, Ederson Reply
      September 18, 2017 at 3:08 pm

      Mr. Bharath

      First to send some email, pleas check if you have a tiny file “.mailrc” in $HOME of this “non root user”.

      Fill the file “.mailrc” with:

      set smtp=smtp.puthereyoursmtpserver
      set ssl-verify=ignore
      set [email protected]
      set font-family:monospace

      enjoy

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy