重庆网站房地产百度账号登陆
Linux Centos配置邮件发送
这里使用的是外部发送邮件方式,也就是使用自己的账号发送
第一步
首先要开启STMP授权码,以QQ邮箱为例
配置文件
vim /etc/mail.rc
找到之后在最下面添加如下
#邮箱set from=3324855376@qq.com #默认smtp发送,stmp发送需要在邮箱内配置,允许stmp发送set smtp=smtp.qq.com#邮箱
set smtp-auth-user=3324855376@qq.com
#邮箱授权码set smtp-auth-password=xkhqkjleqxewchhdset smtp-auth=login
发送邮件-不带附件
# 方式一echo "This is the mail body" | mail -s "邮件标题" 1319900154@qq.com
# 方式二,将文本内容放入邮件body中mail -s "邮件标题" 1319900154@qq.com < /etc/passwd
发送邮件-带附件
mail -s "This is the mail body" -a /home/ttt.txt 1319900154@qq.com < /etc/passwd