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' example@mail.com;

Change myfile.txt, SUBJECT and example@mail.com to something useful.

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

ps -ef|mail -s 'SUBJET' example@mail.com;