mutt + msmtp 在ubuntu使用163邮箱收发邮件

前提:登录163邮箱,在设置中获取客户端授权码

 

1. 安装软件

sudo apt-get install msmtp

sudo apt-get install mutt

2. 配置msmtp

touch ~/.msmtplog

vi ~/.msmtprc

account default
host smtp.163.com
user xxx
from [email protected]
password 网易邮箱客户端授权码
auth login
tls off
logfile ~/.msmtp.log

chmod 600 ~/.msmtprc

 测试:msmtp --host=smtp.163.com --serverinfo

3.配置mutt

 cp /etc/Muttrc ~/.muttrc

set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="xxxxx"
set [email protected]
set envelope_from=yes

测试: echo "hello world" | mutt -s "title" [email protected] 或使用 mutt交互式命令发送邮件

 

你可能感兴趣的:(linux)