uuencode /var/log/messages messages.txt | mailx -s "/var/log/messages on $HOST" me@example.com
uuencode /var/log/messages messages.txt
-- the first parameter is the file to attach, the second is the filename to use for the attachmentmailx -s subject emailaddress
-- takes standard input as the content of the email