which mail
yum -y install mailx
vim /etc/mail.rc
写入:
# mail config set from=zpmail@wp.cpxiang.tech set smtp=smtps://smtp.qq.com:465 set smtp-auth-user=1324928751 set smtp-auth-password=<授权码> set smtp-auth=login set nss-config-dir=/root/.certs set ssl-verify=ignore
mkdir -p /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
cd /root/.certs/ certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
echo "hallo" | mail -v -s "this is Test Mail" 1324928751@qq.com
0 条评论。