I think everybody of you just had this situation. You need to send a log or configuration file from a server to a colleague. If there are some hard security guidelines implemented, it’s quite awkward to copy the files via scp/sftp to your desktop and then mailing the attachments to the receiver.
If you’re on a system with a working mail configuration, you can send the mail directly with one or more attachments. There are several mail clients on the most systems, which can be used for that. I prefer mutt.
echo "This is the content of my mail message" | mutt -s "subject" -a "/var/log/messages" -- firstname.lastname@example.org
-s is the option for the mail subject, -a is the option for the path to the attachment, email@example.com is the mail receiver.
If you need to send multiple attachments, you just can use the -a option more than once like in the example below. And it’s also possible to use a file as mail content at the end of the command with < /tmp/content.txt
mutt -s "subject" -a "/var/log/messages" -a "/etc/resolv.conf" -- firstname.lastname@example.org < /tmp/content.txt
It depends on your mutt version, if the steps above are working, this is tested on a debian 7 server. On RHEL, the following page could help.