Linux send a log (or output from a command) as a mail from the linux console

Sometimes it is nice to send a log or some other file as a email to someone (or a part of a file)

cat myfile.txt | mail -s 'SUBJECT';

Change myfile.txt, SUBJECT and to something useful.

It is also possible to send the output of a command to someone

ps -ef|mail -s 'SUBJET';