使用mailx藉助外網郵箱地址發送郵件

#前言vim


         在centos 命令行上,只是想單純的發送外網郵件,作一些簡單的告警信息,不用複雜的配置,不用花心思,不用動腦筋,那麼使用mailx來作這個事情很是的簡單,很是舒心。centos


#安裝mailxide


          yum -y install mailx測試

  

#配置 mailx命令行


          vim /etc/mail.rc域名


          增長以下參數:it

          set from=user@163.com    #發件人郵箱地址class

          set smtp=smtp.163.com    #smtp地址配置

          set smtp-auth-user=user    #郵箱用戶名,不用加域名密碼

          set smtp-auth-password=123456   #郵箱密碼

          set smtp-auth=login   #郵箱驗證方式


#測試


          好了,就是這麼簡單,如今咱們開始愉快的玩耍吧!


          echo "good boy" | mail  -s  "hi,man"   66666666@qq.com  # -s 郵件標題

          是否是已經接受到測試郵件了

          很是棒!

相關文章
相關標籤/搜索