• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

UNIX / Linux : Send mail with attachment using mutt

by admin

What is mutt

Mutt is a text-based mail client. Mutt is known for being a fast and highly configurable mail client, and since it is text-based, it’s ideal for checking email quickly over SSH.

Installing mutt

To install mutt using yum :

# yum install mutt
...
========================================================================================
 Package            Arch         Version                             Repository    Size
========================================================================================
Installing:
 mutt               x86_64       5:1.5.21-26.el7                     basecd       1.4 M
Installing for dependencies:
 mailcap            noarch       2.1.41-2.el7                        basecd        31 k
 tokyocabinet       x86_64       1.4.48-3.el7                        basecd       459 k
 urlview            x86_64       0.9-15.20121210git6cfcad.el7        basecd        27 k

Transaction Summary
========================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 1.9 M
Installed size: 7.3 M
Is this ok [y/d/N]:y

Sending mail with attachment

Mail can be sent with large message body and attachment using mutt tool.

1. Use mutt command in following format to specify subject, message body and attachment to send mail from command line.

# echo "" | mutt -s "subject" -i body.txt -a attachment.txt recipient@example.com
-s used to specify subject of mail.
-i used to specify file containing message body.
-a used to specify attachment file.

Some other commonly used options with mutt are:

-b used to add Bcc address.
-c used to add Cc address.
-e if you want to specify sender's address (something other than default).
UNIX / Linux : How to install and configure mutt
Linux / UNIX : How to send mails with attachments using mailx command
How to send mails with attachments using the solaris mailx command

Filed Under: Linux

Some more articles you might also be interested in …

  1. husky Command Examples
  2. Which network ports are reserved by the Linux Operating System?
  3. Ngrok how to share localhost to world
  4. Basic vi commands (cheat sheet)
  5. guake: command not found
  6. flyctl: Command-line tool for flyctl.io
  7. brotli: Compress/uncompress files with Brotli compression
  8. How to Lock and Unlock Zimbra Accounts from Command Line
  9. rusnapshot: command not found in Linux
  10. ndctl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright