Linux下使用mutt发送邮件

sudo apt-get install mutt msmtp

配置文件 cat ~/..muttrc

set realname            = "kyle"
set from                = "kyle@mfhui.com"
set use_from            = yes
set envelope_from       = yes
set spoolfile           = /home/kyle/spool/mail/kyle
set sendmail="/usr/bin/msmtp"

cat ~/.msmtprc

account default
host smtp.exmail.qq.com
from kyle@mfhui.com
auth plain
user kyle@mfhui.com
password yourpassword
logfile ~/.msmtp.log
chmod 600 .msmtprc
touch ~/.msmtp.log

echo "This is the message body" | mutt -a "/home/kyle/shell/import_vtalk.sh" -s "subject of message" -- kyle@mfhui.com