Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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

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

:~ mailme myfile

Any idea on how to do that?

share|improve this question
up vote 12 down vote accepted

The command

open -a [filename(s)]

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

share|improve this answer
excellent, thanks, I'll make myself an alias – kaklon Nov 15 '11 at 16:32

Works also with Thunderbird

open -a Thunderbird filename

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

share|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
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

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.