linux使用mail发邮件

默认的mail不能对外发邮件,修改/etc/mail.rc,增加以下内容:

set [email protected]
set smtp=smtp.163.com
set smtp-auth-user=report3
set smtp-auth-password=password
set smtp-auth=login


测试:

echo "mailbody" | mail -s "subject" [email protected]

mail -s "mail subject" [email protected] < yourbody.txt


检查[email protected]有无收到邮件

你可能感兴趣的:(linux)