• 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. CentOS / RHEL 7 : How to enable or disable automatic updates (via packagekit)
  2. “mount.nfs: access denied by server while mounting” – how to resolve
  3. CentOS / RHEL 6 : How do I find my current runlevel?
  4. How to enable md5 Hashing in Linux
  5. Linux OS Service ‘avahi-daemon’
  6. How to install an RPM package into a different directory in CentOS/RHEL/Fedora
  7. Understanding the Network interface configuration file /etc/sysconfig/network-scripts/ifcfg-eth#
  8. How to Increase KVM Guest Memory Resources
  9. CentOS / RHEL : How to create and host yum repository over httpd
  10. How to install and configure VNC Server on CentOS/RHEL 8

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright