apt-get install mutt
apt-get install msmtp
cp -rv /etc/Muttrc ~/.muttrc
vi ~/.muttrc(最后添加)
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="yangming0"
set [email protected]
set envelope_from=yes
:wq
vi ~/.msmtprc
account default
host smtp.126.com
user yangming0
from [email protected]
password xxxxxxx (此处为126邮箱的授权码)
auth login
tls off
logfile ~/.msmtp.log
:wq
echo "hello" | mutt -s "title" [email protected]
附:
126邮箱授权码:
登录126邮箱,设置——POP3/SMTP/IMAP——勾选POP3/SMTP服务——短信验证码——设置授权码
原文地址:http://blog.51cto.com/yangzhiming/2105501
时间: 2024-11-10 14:17:18