Mailx安装及设置smtp发送邮件

示例搭建

环境

系统 IP 软件
centos7.6 无所谓 mailx

操作步骤

]# yum -y install mailx
]# vim /etc/mail.rc
]# ss -tnlp #检查25端口是否开启
]# systemctl status postfix #检查postfix服务状态或者安装sendmail都可以
#网易邮箱
set from=xxx@163.com
set smtp=smtp.163.com 邮件服务器
set smtp-auth-user=xxx
set smtp-auth-password=xxxxx 163邮箱授权码
set smtp-auth=login

邮件格式:echo "邮件内容" | mail -s "邮件主题" 收件人邮箱地址
~]# echo "hello test" | mail -s "test message" xxx@163.com
posted @ 2020-05-05 11:22  wanwz  阅读(139)  评论(0)    收藏  举报