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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. What are Symbolic Links (Soft Links) and how to create them under Linux
  2. “Volume “myvg/vol01″ Is Not Active Locally” – CentOS/RHEL
  3. sftp: command not found
  4. How to add Source, Services and Ports to Firewall Zone in CentOS/RHEL 7 and 8
  5. engrampa: command not found
  6. CentOS / RHEL 7 : Unable To Start The Samba Service
  7. virt-manager: command not found
  8. CentOS / RHEL 6 : How to disable Transparent Huge pages (THP)
  9. swapon and swapoff Command Examples in Linux
  10. Changing the IPset rules from IPtables to Firewalld in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright