Last Updated: June 11, 2021
·
2.805K
· dget

Quickly Email File From Shell

The below isn't an ideal solution (for one, it'll be marked as coming from your email) for heavy duty use, but awesome for quickly getting a file off of your computer and into an inbox.

uuencode filename.txt filename.txt | mail -s "Subject" dan@lore.com

3 Responses
Add your response

do you mean it'll be marked as coming from your machine not your email? (i.e. username (at) machine_name (dot) local)

over 1 year ago ·

@arpohahau
it'll be marked as what you put in the brackets.

For the uuencode, is there any convenient way to format it as regular email attachment so that we do not need to run commands at the recipient side?

over 1 year ago ·

Great tip! Thanks for sharing.

It will be sent as the account configured in the machine/users mail transfer agent. A MTA will need to be configured for the mail command to work.

SSMTP is a good MTA for Ubuntu.
Postfix comes with OSX.

Both can be configured to relay mail through gmail SMTP.

over 1 year ago ·