说明:
1.本文是用网易smtp服务,QQ的没试过
2.在Centos7上测试
实现:
1.关闭本机的sendmail服务或者postfix服务
sendmail
# service sendmail stop
# chkconfig sendmail off
postfix
# service postfix stop
# chkconfig postfix off
2.修改/etc/mail.rc,增加一下类似N行,指定外部的smtp服务器地址、帐号密码等,前提网易SMTP服务要开启
![](https://images2017.cnblogs.com/blog/338478/201711/338478-20171116162021031-1095705169.png)
![](https://images2017.cnblogs.com/blog/338478/201711/338478-20171116155608515-1728021392.png)
3.然后通过命令来发送邮件
![](https://images2017.cnblogs.com/blog/338478/201711/338478-20171116160430421-200606099.png)
4.邮箱接收效果
![](https://images2017.cnblogs.com/blog/338478/201711/338478-20171116160627640-1259495873.png)