![install mail command in linux install mail command in linux](https://linuxhint.com/wp-content/uploads/2021/12/How-to-use-mail-command-in-Linux10.png)
Rhui-REGION-rhel-server-rh-common | 3.8 kB 00:00 Rhui-REGION-rhel-server-releases-optional/primary_db | 5.4 MB 00:00 Rhui-REGION-rhel-server-releases-optional | 3.5 kB 00:00 Rhui-REGION-rhel-server-releases/primary_db | 56 MB 00:00 Rhui-REGION-rhel-server-releases | 3.5 kB 00:00 Rhui-REGION-client-config-server-6 | 2.9 kB 00:00 This is it with mutt command for now, read man pages of mutt for more information on mutt command.Loaded plugins: amazon-id, rhui-lb, search-disabled-repos, security Z open the first folder with new message, exit immediately if none z exit immediately if there are no messages in the mailbox y select a mailbox specified in your `mailboxes' list v show version and compile-time definitions s specify a subject (must be in quotes if it has spaces) n causes Mutt not to read the system Muttrc i specify a file which Mutt should include in the reply H specify a draft file to read header from e specify a command to be executed after initialization b specify a blind carbon-copy (BCC) address To print the help menu of “ mutt”, we need to specify “ -h” option with it. Set realname = "Realname of the user" Getting Help If we want to change the senders name and email, then we need to Create a file in that particular user’s home directory. Here in above snapshot, you can see that it shows attachment attached with the mail. ~]# mutt -s "Subject of Mail" -a -c mail address of recipient ~]# mutt -s "Site Backup" -a /backups/backup.tar -c Send Email Attachment from Terminal We can send email from command line with attachments by using “ -a” option with mutt command. Send Mail as CC or BCC in Terminal Send Emails with Attachments Here in this example, root is sending email to and putting as Cc address and as Bcc. ~]# mutt -s "Subject of mail" -c -b mail address of recipient ~]# mutt -s “Test Email” -c -b We can add Cc and Bcc with mutt command to our email with “ -c” and “ -b” option. Send Mail from Terminal Add Carbon copy(Cc) and Blind Carbon copy(Bcc) Note: When you press “ y” it shows the status below that mutt is sending mail. Change recipient email address pressing t.When you enter the above command in the terminal, it opens up with an interface and confirms the recipient address and subject of the mail and opens up the interface, here you can make changes to recipient mail address. The “ -s” option is used to specify Subject of the mail. In this example, following command will send a test Email to. You may also use “ -R” option to open a mailbox in read-only mode. For example, You (as root) wants to read mails of user “ John“, you need to specify his mail file with “ -f” option with mutt command.
![install mail command in linux install mail command in linux](https://keepfloyding.github.io/images/archbtw.png)
To read the emails of a specific user, you need to specify which mail file to read. To read emails of the user with you are currently logged in, you just need to run “ mutt” on the terminal, it will load the current user’s mailbox.
#Install mail command in linux install
# apt-get install mutt (For Debian / Ubuntu based system) # yum install mutt (For RHEL / CentOS / Fedora based system) Configuration filesĬonfiguration files of Mutt Email client. We can install Mutt Client in our Linux box very easily with any package installers as shown. It also support DSN ( Delivery Status Notification).It also support so many mailbox formats like maildir, mbox, MH and MMDF.It provides us the facility of mailing lists.It also has the features to add BCC ( Blind carbon copy) and CC ( Carbon copy) while sending mails.Allows us to send emails with attachments from the command line.Its very Easy to install and configure.Some other important features of Mutt is as follows: It opens with a coloured interface to send Email which makes it user friendly to send emails from command line. Mutt also supports POP and IMAP protocols for receiving mails. It’s a very useful and powerful tool to send and read mails from command line in Unix based systems. Mutt is a command line based Email client.
![install mail command in linux install mail command in linux](https://www.fosslinux.com/wp-content/uploads/2020/03/send-emails-using-the-command-line-Linux.png)
![install mail command in linux install mail command in linux](https://blog.edmdesigner.com/content/images/2018/03/mail-log.png)
Here in this tutorial, we’ll be using the mutt (a terminal email client) command to send email from command line interlace. As a System admin, sometimes we need to send mails to users or someone else from the server and for that we used to go with a web based interface to send email, is it really that handy ? Absolutely No.