http://www.tuaw.com/2008/04/19/terminal-tip-easy-email-attachments/
This is a nice short little article. I’m always forgetting how to do mail attachments with mailx at work, and this gave me nice reminder: uuencode
The magical command in this one is uuencode, which is used to encode and decode binary files and can be used on just about any file type. The two arguments in the command above define the name and location of the source file and the name the file should have when it’s received. The parenthetical statement at the beginning combines the results of the echo and uuencode commands which are then piped (|) to the mail command.
So, remember folks:
(echo "This is the message body";uuencode [file_location] \
[file_name] ) | mailx -s "Subject line here" \
someone@adomain.com
Comments
There are no comments yet for this entry.