Chinaunix首页 | 论坛 | 博客
  • 博客访问: 280449
  • 博文数量: 66
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 455
  • 用 户 组: 普通用户
  • 注册时间: 2015-11-25 09:52
个人简介

no pains no gains

文章分类

全部博文(66)

文章存档

2017年(10)

2016年(39)

2015年(17)

我的朋友

分类: 系统运维

2016-05-06 15:25:35

1.检查sendmail是否安装
[root@localhost ~]# rpm -qa |grep sendmail
sendmail-8.14.4-9.el6.x86_64
[root@localhost ~]# which sendmail
/usr/sbin/sendmail

2.我使用的是163邮件,所以设置mail使用163代理发邮件只需要在  /etc/mail.rc   最后添加两行即可

set from=getdata2016@163.com smtp=smtp.163.com
set smtp-auth-user=getdata2016@163.com smtp-auth-password=xxxxx[这里是搜权码,不是邮箱密码] smtp-auth=login

3.虽然我们设置了linux使用客户端用163的发邮件,可是还需要登陆到邮箱里设置POP3/SMTP/IMAP

4.测试邮件发送
[root@localhost ~]# echo test | mail -s test getdata2016@163.com
[root@localhost ~]# smtp-server: 535 Error: authentication failed
"/root/dead.letter" 11/301
. . . message not sent.
这里就是因为上面填了邮箱密码而不是搜权码,导致邮件发送失败。更改为搜权码后,发送成功。
echo test | mail -s test1111 getdata2016@163.com

发送多人只需发件人后面加空格  echo test22222222222 | mail -s test1111 xxx@xxx.com  getdata2016@163.com
阅读(1957) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~