1.安裝mailx
yum -y install mailx
2. /etc/mail.rc 最后增加郵件配置如
set smtp=smtp.qq.comset smtp-auth=loginset smtp-auth-user=*******@qq.comset smtp-auth-password=*****set from=*****@qq.com
3.命令行 mail -s "hello" 100****@qq.com #回車輸入內容, ctrl+d 結束輸入