在shell中使用sendmail發送郵件

cat > sendmymail.shbash

 

#!/bin/bash
/usr/sbin/sendmail -t <<EOF
From: Mail testing <abc@gmail.com>          
To: abc@gmail.com                                      
Cc: abc@gmail.com                                    
Bcc: abc@gmail.com                                  
Subject: mail testing                                          
----------------------------------                               
This is the mail content ...
---------------------------------
EOFspa

 

chmod u+x sendmymail.ship

./sendmymail.shci


man sendmail

-t參數的含義

-t     Read message for recipients. To:, Cc:, and Bcc: lines will be
              scanned for recipient addresses. The Bcc: line will be deleted
              before transmission.io

相關文章
相關標籤/搜索