5

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 -- me@company.com,you@company.com

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

2 Answers 2

8
echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt -a two.txt -- me@company.com,you@company.com

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

6

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 -- me@company.com,you@company.com
2
  • which mutt version should I use? I tried the above command but only the first file is being sent. Mutt 1.4.2.2i (2006-07-14)
    – shantanuo
    Mar 14, 2011 at 9:10
  • @shantanuo I use 1.5.21. Please add your version to the question.
    – graphite
    Mar 14, 2011 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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