找到配置文件/etc/mail.rc添加如下行
# vi /etc/mail.rc
set [email protected]
set smtp=smtp.qq.com
set smtp-auth-user=123456
set smtp-auth-password=sbsbsbsb
set smtp-auth=login
通过以下命令发送邮件
echo hello word | mail -s " title" [email protected] [email protected]
多个邮件地址使用空格分开