阿里云ECS发送邮件到腾讯企业邮箱

1、安装软件

yum install mailx

yum install sendmail

2、配置

vim /etc/mail.rc在文件最后加上如下内容:

set smtp=smtps://smtp.exmail.qq.com:465   #邮箱服务器地址

set [email protected]           #发送邮件的来源
set [email protected]  #用户名
set smtp-auth-password=xxxx   #密码
set nss-config-dir=/etc/pki/nssdb/  #证书位置
set ssl-verify=ignore
set smtp-auth=login

3、配置证书

mkdir -p /etc/pki/nssdb/
cd /etc/pki/nssdb
#生成证书
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/nssdb/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt
certutil -L -d /etc/pki/nssdb/
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt #认证

4、测试发送邮件

扫描二维码关注公众号,回复: 3407557 查看本文章

echo "this email come from centos"|mail -v -s "zabbix"   [email protected]

猜你喜欢

转载自www.cnblogs.com/abkn/p/9720143.html