Bash - how to use sendmail

阅读更多
touch exeSendMail.ksh
touch eg.txt
1, eg.txt content:
hello world!

2, write in exeSendMail.ksh
Send mail
(
        echo "From: SANT";
        echo "To: [email protected]";       
        echo "Subject: send email";
        cat eg.txt
)| /usr/sbin/sendmail -t

my mail [email protected] will recive email with content "hello world!" from SANT

你可能感兴趣的:(Unix)