mailx使用smtp邮箱发送邮件

kevin.Zhu 发布于:2021-7-7 21:04 分类:文摘  有 20 人浏览,获得评论 0 条  

https://www.cnblogs.com/ying568353087/p/13365061.html?utm_source=tuicool


注意阿里云已经封禁25端口,必须先配置ssl登录

https://www.cnblogs.com/liutao97/p/8387244.html

 

mkdir -p /root/.certs/

echo -n | openssl s_client -connect smtp.126.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -L -d /root/.certs<br><br>若需要qq的ssl  只需把第二条命令中的smtp.xxx.com:465  给替换了就行
 
set from=xxxooo@126.com
set smtp=smtps://smtp.126.com:465
set smtp-auth-user=xxxooo@126.com
set smtp-auth-password=你的授权码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs
 
/etc/mail.rc
测试邮件:

echo "HEllo_test_test1" | mailx -v -s "zabbix_test_mail" 568353087@qq.com