操作系统:centos 6.8
1. 安装mailx
yum install mail
2. 配置SMTP
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
3. 生成SSL证书
mkdir ~/.certs && certutil -N -d ~/.certs
4. 发送测试邮件
echo "test mail" | mail -vvv -s "subject" **@qq.com
参考:
http://www.51xpage.com/%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AE%A1%E7%90%86/2015/12/10/dao-ting-tu-shuo-linux-xi-lie-9-fa-song-wai-bu-you-jian