linux 发邮件
环境:debian
apt install msmtp
chmod 600 ~/.msmtprc
.msmtprc内容如下:
# Gmail account
account default
host smtp.gmail.com
port 587
from <你的邮箱>
auth on
user <你的邮箱>
password <设置你的密码>
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
注意:谷歌邮箱需创建应用专用密码
echo -e "Subject: 标题\n内容" | msmtp <邮箱(发给谁)>

浙公网安备 33010602011771号