安装 mailx yum install mailx
进入配置 vi/etc/mail.rc 进入最低部 写入下面代码
163邮箱转发
set from=18300715791@163.com
set smtp=smtp.163.com:25
set smtp-auth=login
set smtp-auth-user=****@163.com
set smtp-auth-password=****
set ssl-verify=ignore
set nss-config-dir=/etc/maildbs/
qq 邮箱转发
vi /etc/mail.rc
set from=***@qq.com
set smtp-auth-user=***@qq.com
set smtp-auth-password=igsre***
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=~/.certs
set smtp=smtps://smtp.qq.com:465
生成SSL证书
mkdir ~/.certs && certutil -N -d ~/.certs
echo -e "你好!n我来看看你n哈哈" | mail -s "测试邮件" 169***47@qq.com