Linux下可以通过使用mail命令,利用外部的一个邮箱(比如xxx.163.com)发送邮件到另外一个邮箱(比如yyy.qq.com),这在某些情况下很有用,比如监测系统温度,当温度达到一定时就报警,向邮箱发送报警信息,提示管理员网络异常等。

找到配置文件/etc/mail.rc添加如下行
# vi /etc/mail.rc
set from=123456@qq.com
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" 123456@qq.com 1234567@qq.com
多个邮件地址使用空格分开
以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !
