环境
系统:CentOS 6.8
准备
- 安装扩展yum源
# yum -y install epel-release
msmtp安装配置
-
安装
# yum -y install msmtp
-
配置(若无/etc/msmtprc,请自建)
# vim /etc/msmtprc defaults logfile /var/log/msmtp.log account username host smtp.163.com from username@163.com auth login user username@163.com password yourpassword account default: username
mutt安装配置
-
安装
# yum -y install mutt
-
配置
# vi /etc/Muttrc set from="username@163.com" set sendmail="/usr/bin/msmtp" set use_from=yes set realname="张三" set editor="vim"
测试
# echo hello | mutt -s testmail testuser@163.com