7

I am often using the terminal, and I'd like to be able type a command that will attach a selected file to an email in mail.app.

:~ mailme myfile

Any idea on how to do that?

2 Answers 2

13

The command

open -a Mail.app [filename(s)]

opens a "New Message" window in Mail.app, with the filename(s) attached.

1
  • FYI: you can do open -a Mail.app `ls *.pdf` to put the reuslts of ls into the mail
    – Rho Phi
    Sep 18, 2016 at 21:38
5

Works also with Thunderbird

open -a Thunderbird filename

It seems that yout can attach only one file to a new e-mail.

2
  • Could you give an example for open -a Thunderbird [filename(s)] . I tried the following but none worked open -a Thunderbird ["filename1","filename2"] open -a Thunderbird [filename1,filename2] open -a Thunderbird ['filename1','filename2'] for single files open -a Thunderbird filename works like a charm.
    – avk
    Nov 3, 2012 at 3:41
  • 1
    Oops, sorry. I did't tested it before posting. It seems attaching more files doesn't work. I'll edit the answer.
    – Dali
    Nov 19, 2012 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .