首先得把软件包给安装上去
apt-get install mutt msmtp

配置msmtp指定邮箱帐号密码
nano ~/.msmtprc

account default
host smtp.163.com
from xxx@163.com
auth login
user xxx@163.com
password xxxxxx
logfile ~/msmtp.log

配置mutt通过msmtp发信
nano ~/.muttrc

set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="闲人"
set from=866134@163.com
set envelope_from=yes

set charset="utf-8"
set send_charset="utf-8"
set locale = "zh_CN.UTF-8"
set content_type = "text/html\;charset=utf-8"

测试发送
echo "hello world" | mutt -s "邮件标题" test@qq.com

如果其他问题,查阅~/msmtp.log即可

标签: none

添加新评论