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
Written by Dan Getelman
Related protips
3 Responses
do you mean it'll be marked as coming from your machine not your email? (i.e. username (at) machine_name (dot) local)
@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?
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.