使用外部SMTP发送邮件

来源:互联网 发布:美篇同类软件 编辑:程序博客网 时间:2024/05/18 01:19

yum -y install mailx

vim /etc/mail.rc

使用阿里云企业邮箱发送邮件

set from=abc@abc.cn
set smtp=smtp.mxhichina.com
set smtp-auth-user=abc@abc.cn
set smtp-auth-password=123456
set smtp-auth=login

使用网页126邮箱发送邮件
#set from=abc@126.com
#set smtp=smtp.126.com
#set smtp-auth-user=abc
#set smtp-auth-password=123456
#set smtp-auth=login

-----------------------------------------------------------

发送方式一:无附件

cat /tmp/2017-01-22.txt | mail -s "test"  abc@bengroup.cn

发送方式二:有附件

cat /tmp/邮件内容.txt |  mail -s "test" -a /tmp/2017-01-22.txt -- abc@bengroup.cn

0 0