Brainstorm's snippets (1/253)

  Send email from command line

Using mail

    Subject: Hello World!
    This is an email to myself.

    Hope all is well.

and terminate with ^D.


echo "this is a test mail" | mail -s'send mail test'

Using mailx

mailx -s "subject" -r, < textfile

Using mailx with attachment

mailx -A attchment_file -s "subject" -r, < textfile

Test what's happening

tail -f /var/log/mail.log