Linux下往外网发送邮件(适用于发送报警邮件时用)
- yum安装mailx软件
yum install mailx -y
- 更改配置文件 /需要进入邮箱后台开启smtp登录,获取密码在下面password中填写
vim /etc/mail.rc
set from[email protected].com smtp=smtp.xxx.com
set smtp-auth-[email protected].com smtp-auth-password=password
set smtp-auth=login
- 发送邮件测试
echo “发送邮件内容” | mail -s “主题(标题)” [email protected]
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/2046.html