Text files can easily be sent as the body of an email as shown above. If you need to send something as an attachment, you have to encode it. I like mpack, but have used uuencode as well. Here's my snippets:
cat filename | uuencode attachmentName | mailx –m –s “Subjest”
someone@somewhere.com
#/usr/local/bin/mpack -s "Test Email" -c application/octet-stream ./oracle_trace_file.trc
me@myaddress.com