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<[email protected]>";
        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<[email protected]>

猜你喜欢

转载自bonnietang.iteye.com/blog/2359817