在shell中使用sendmail發送郵件


cat > sendmymail.sh

 

#!/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 ...
---------------------------------
EOF

 

chmod u+x sendmymail.sh

./sendmymail.sh


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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM