shell - Centos 6 /usr/sbin/sendmail - how to send email with subject? -
trying send email shell (centos 6) using 1 line command, subject empty echo 'body' | /usr/sbin/sendmail x@gmail.com subject:"test send mail" spent hours trying googling , find answer how send email using "/usr/sbin/sendmail" subject, no matter try, subject empty. (echo "subject: test"; echo; echo 'body')|/usr/sbin/sendmail -i x@gmail.com or cleaner script version #!/bin/sh /usr/sbin/sendmail -i x@gmail.com <<end subject: test body end warning : non us-ascii characters require special encoding in headers , custom headers when included in body.