Ubuntu 系统上使用 QQ 邮箱的 SMTP 服务器发送邮件,msmtp(已验证)

  1. 安装 msmtp
sudo apt-get update
sudo apt-get install msmtp

2 .配置 msmtp

nano ~/.msmtprc
defaults
auth           on
tls            on
tls_starttls   on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

account        qq
host           smtp.qq.com
port           587
from           [email protected]
user           [email protected]
password       your_password

# Set a default account
account default : qq
chmod 600 ~/.msmtprc
  1. 测试发送邮件
echo -e "Subject: Test\nThis is a test email." | msmtp -a qq [email protected]

你可能感兴趣的:(ubuntu,linux,运维)