使用Linux发送邮件

1、安装

yum -y install mailx
yum install sendmail 
yum install postfix 
#sendmial
service sendmail stop
chkconfig sendmail off
#postfix
service postfix stop
chkconfig postfix off
#Ubuntu:  sudo apt-get install heirloom-mailx

2、配置

vi /etc/mail.rc

...
# For Linux and BSD, this should be set. set bsdcompat set from
=XXX@qq.com set smtp=smtp.qq.com set smtp-auth-user=XXX@qq.com set smtp-auth-password=izjlwrkzzeqwfccc (修改为你的授权码) set smtp-auth=login

 

3、测试发送

echo "Content" | mail -s "Title"  XXX@qq.com

原文地址:https://www.cnblogs.com/zjazn/p/15621859.html