SHELL要发送HTML这类邮件的话,还得靠msmtp 和 mutt

时间:2022-11-17 05:11:35

参考蛮多的。。

http://storysky.blog.51cto.com/628458/293005

http://www.wilf.cn/post/centos-mutt-msmtp-setup.html

http://www.centoscn.com/image-text/config/2013/0817/1286.html

我都省事的YUM安装,,相关文件内容如下:

/etc/msmtprc

account default
host xx..com
user a@a.com
password 345wrtsdxcbasdf
from a@a.com
maildomain a.com
auth login
logfile /var/log/mmlog

/etc/Muttrc.local

# Local configuration for Mutt.
#
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="a@a.com"
set editor="vi" 

测试:

echo "testmail" | mutt -s "测试" b@a.com

SHELL要发送HTML这类邮件的话,还得靠msmtp 和 mutt