SHELL发送邮件
shell发送邮件
1.配置
QQ邮箱测试
QQ邮箱设置 打开各服务生成授权码
linux开启 postfix 服务
service postfix start
创建certs目录,创建证书文件,配置授权码
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
certutil -L -d /root/.certs
进入 certs目录
cd /root/.certs/
执行命令certutil -A -n “GeoTrust SSL CA - G3” -t “Pu,Pu,Pu” -d ./ -i qq.crt
出现Notice: Trust flag u is set automatically if the private key is present. 成功
编辑 /etc/mail.rc 配置授权码 在文件末尾加上配置
2.发送邮件文本内容 无附件
3.发送邮件带附件
4.发送邮件html格式
QQ邮箱只能显示文本 改成163邮箱测试