安装sendmail

yum install -y sendmail

编辑/etc/mail/local-host-names

vim /etc/mail/local-host-names

填写主机名

配置sendmail(这里以263邮箱为例)

vim /etc/mail.rc

set from=你想接收方看到的收件人名字,helloworld都行
set smtp=smtp.263.net
set smtp-auth-user=你的邮箱
set smtp-auth-password=邮箱认证
set smtp-auth=login

重启sendmail

systemctl restart sendmail


测试

echo "test sendmail"|mail -s "title" 目标邮箱地址