Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the following example, I can use comma to send the same message to 2 recipients. But I can not use comma to send 2 files.

echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt --,

How do I send the second.txt file in the same command?

share|improve this question

migrated from Mar 15 '11 at 17:17

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted
echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt -a two.txt --,

Should work. A lot more work for 10-20 files though.

share|improve this answer

As said in mutt manual (version 1.5.21).

-a file [...] Attach a file to your message using MIME. When attaching single or multiple files, separating filenames and recipient addresses with "--" is mandatory, e.g.

mutt -a image.jpg -- addr1 or mutt -a img.jpg *.png -- addr1 addr2

The -a option must be placed at the end of command line options.

So this will be ok:

echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt second.txt --,
share|improve this answer
which mutt version should I use? I tried the above command but only the first file is being sent. Mutt (2006-07-14) – shantanuo Mar 14 '11 at 9:10
@shantanuo I use 1.5.21. Please add your version to the question. – graphite Mar 14 '11 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.