linux 發(fā)郵件
環(huán)境:debian
apt install msmtp
chmod 600 ~/.msmtprc
.msmtprc內(nèi)容如下:
# Gmail account
account default
host smtp.gmail.com
port 587
from <你的郵箱>
auth on
user <你的郵箱>
password <設(shè)置你的密碼>
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
注意:谷歌郵箱需創(chuàng)建應(yīng)用專用密碼
echo -e "Subject: 標(biāo)題\n內(nèi)容" | msmtp <郵箱(發(fā)給誰)>

浙公網(wǎng)安備 33010602011771號