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?


The command

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

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

| improve this answer | |
  • FYI: you can do open -a Mail.app `ls *.pdf` to put the reuslts of ls into the mail – Rho Phi Sep 18 '16 at 21:38

Works also with Thunderbird

open -a Thunderbird filename

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

| improve this answer | |
  • 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 '12 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 '12 at 11:21

You must log in to answer this question.

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