5

I try to create a new message with several attachments via command line, but this does not work:

thunderbird -compose "attachment='/etc/mtab',attachment='/etc/fstab'"

Only the first file gets attached. The second is missing.

What is wrong with the above command line?

PS: I tried xdg-email first, but this fails. See How to open the user's preferred mail application on Linux?

Community
  • 1
  • 1
guettli
  • 25,042
  • 81
  • 346
  • 663

2 Answers2

9

the command must be specified as

thunderbird -compose "attachment='/etc/mtab,/etc/fstab'"

I have tried under windows.

Magoo
  • 77,302
  • 8
  • 62
  • 84
RoddeChime
  • 106
  • 1
  • 1
    I tried it under linux, it works too. Note however that the attachment must be written with its absolute path. – Johann Bzh Dec 19 '18 at 09:10
  • Note that if you call this from python, you have to replace the comma by %2C `import os command = f'thunderbird -compose to="{receiver}",subject="{subject}",body="{body_text}",attachment="{file_path1}%2C{file_path2}"' os.system(command)` – Jens Wagemaker Aug 17 '23 at 10:38
0

Another way to attach several files:

thunderbird.exe -compose to="info@gmail.com" ,subject="SubjectText" ,body="bodytext" ,attachment='D:\File.txt,D:\File2.txt'
Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
Roman
  • 21