1. 程式人生 > >Ubuntu使用mutt+msmtp發郵件

Ubuntu使用mutt+msmtp發郵件

mutt+msmtp

Ubuntu使用mutt+msmtp發郵件

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服務——短信驗證碼——設置授權碼

Ubuntu使用mutt+msmtp發郵件