Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

Sending Email Attachments with Linux

Feb 18

In the past I’ve always wondered how to send email attachments from the command line on Linux. I used to be able to email text based files using the mail command:

mail user@domain.com < yourfile.txt

This is useful but actually embeds the text into the body of the email. I recently learned how to send this text as an attachment using the mutt command. The syntax looks like:

mutt -a yourfile.txt user@domain.com < /dev/null

The body text can be imported from an external file and in this case I’m telling it not to send any body text using /dev/null.

This might not be the only way to send attachments from the command line so if you know of any other approaches then please feel free to post them!

Leave a Reply