使用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

 

posted @ 2021-11-29 22:32  小庄的blog  阅读(105)  评论(0编辑  收藏  举报