說明:服務器
1.本文是用網易smtp服務,QQ的沒試過post
2.在Centos7上測試測試
實現:spa
1.關閉本機的sendmail服務或者postfix服務3d
sendmail
# service sendmail stop
# chkconfig sendmail off
postfix
# service postfix stop
# chkconfig postfix off
2.修改/etc/mail.rc,增長一下相似N行,指定外部的smtp服務器地址、賬號密碼等,前提網易SMTP服務要開啓
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
3.而後經過命令來發送郵件
![](http://static.javashuo.com/static/loading.gif)
4.郵箱接收效果
![](http://static.javashuo.com/static/loading.gif)