How to send email from Terminal?

NoobDev4iPhone picture NoobDev4iPhone · Nov 24, 2011 · Viewed 344.4k times · Source

I know there are ways to send email from terminal in Linux/MacOS, but I can't seem to find proper documentation on how to do that.

Basically I need it for my bash script that notifies me every time there is a change in a file.

Answer

earldouglas picture earldouglas · Nov 24, 2011
echo "this is the body" | mail -s "this is the subject" "to@address"