Every once a while you need to send email from a Linux command line and there you go to google try to find it…
With attachment:
echo "message" | mailx -s "subject" -a attachment email@dress
echo "message" | mutt -s "subject" -a attachment -- email@dress
Without attachment:
echo "message" | mail -s "subject" email@ddress
Important:
Postfix by default restrict attachment size to approx 10MB i.e. 10240000 bytes.
You can check it using following command:
postconf | grep message_size_limit
To change attachment-size to say 50 MB, run a command like:
postconf -e message_size_limit=52428800