欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Bash - how to use sendmail

程序员文章站 2022-07-11 08:12:06
...
touch exeSendMail.ksh
touch eg.txt
1, eg.txt content:
hello world!

2, write in exeSendMail.ksh
Send mail
(
        echo "From: SANT<SANT@gmail.com>";
        echo "To: bonnie.tang@gmail.com";       
        echo "Subject: send email";
        cat eg.txt
)| /usr/sbin/sendmail -t

my mail bonnie.tang@gmail.com will recive email with content "hello world!" from SANT<SANT@gmail.com>
相关标签: Unix