以下是自己收集的实用Linux下简单配置外部邮箱发送邮件的方法:
1、配置/etc/mail.rc,使用mail命令
# vim /etc/mail.rc
###调用外部邮箱
set from=test@qqextend.com
set smtp=smtp.exmail.qq.com
set smtp-auth-user=test@qqextend.com
set smtp-auth-password="XXXXXX"
然后使用mail命令即可发送邮件了
2、msmtp+mutt方式
msmtp下载地址:https://sourceforge.net/projects/msmtp/files/msmtp/
1)安装msmtp
# wget http://heanet.dl.sourceforge.net/project/msmtp/msmtp/1.6.5/msmtp-1.6.5.tar.xz
# xz -d msmtp-1.6.5.tar.xz
# cd msmtp-1.6.5
# ./configure --prefix=/usr/local/msmtp
# make && make install
2)配置msmtp
# vim ~/.msmtprc
account default
host smtp.exmail.qq.com
from test@qqextend.com
user test@qqextend.com
password XXXXXX
logfile ~/.msmtp.log
3)安装配置mutt
# yum instal mutt �y
# vim /etc/Muttrc
set sendmail="/usr/local/msmtp/bin/msmtp"
set use_from=no
set realname="XXXXXX"
set editor="vim"
4)发送邮件
# echo "这里是正文" |mutt -s "这里是标题" my@163.com
原文链接:https://www.f2er.com/centos/381541.html