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

1、安装软件

yum install mailx

yum install sendmail

2、配置

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

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

set from=xxxx@xxx.com           #发送邮件的来源
set smtp-auth-user=xxxx@xxx.com  #用户名
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、测试发送邮件

echo "this email come from centos"|mail -v -s "zabbix"   xxx@xxx.com

 

转载于:https://www.cnblogs.com/abkn/p/9720143.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值