1.打开QQ/163邮箱的 IMAP/SMTP服务,并获取授权密码
2.安装、配置
yum -y install mailx
#在最后面添加下面参数,或者直接执行面命令
vim /etc/mail.rc
3.QQ邮箱
#QQ邮箱参数
set from=自己的QQ邮箱号
set smtp=smtps://smtp.qq.com:465
set ssl-verify=ignor
set nss-config-dir=/root/.certs
set smtp-auth-user=自己的QQ邮箱号
set smtp-auth-password=授权码
set smtp-auth=login
#创建QQ邮箱证书密匙
mkdir /root/.certs
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -L -d ~/.certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs/ -i ~/.certs/qq.crt
4.163邮箱
#163配置参数
set from=授权密码的邮箱号
set smtp=smtps://smtp.163.com:465
set ssl-verify=ignore
set nss-config-dir=/root/.certs
set smtp-auth-user=授权密码的邮箱号
set smtp-auth-password=邮箱授权密码
set smtp-auth=login
#创建163邮箱证书密匙
mkdir /root/.certs
echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
certutil -L -d /root/.certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs/ -i ~/.certs/163.crt
5.echo “测试发送邮件” | mail -s “Title” 接收信息邮件 xxx@qq.com
评论区