欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          為了使用郵箱服務(wù),php7該如何配置sendmail

          Sendmail作為一種免費(fèi)的郵件服務(wù)器軟件,已被廣泛的應(yīng)用于各種服務(wù)器中,它在穩(wěn)定性、可移植性、及確保沒(méi)有bug等方面具有一定的特色,且可以在網(wǎng)絡(luò)中搜索到大量的使用資料。

          為了使用郵箱服務(wù),php7該如何配置sendmail

          假如嫌自己配置服務(wù)器麻煩,直接使用PHPMailer調(diào)用第三方郵件服務(wù)器,簡(jiǎn)單省事。git地址如下:

          https://github.com/PHPMailer/PHPMailer

          1.安裝組件

          yum install sendmail mailx

          2.修改配置文件/etc/mail.rc

          添加下列參數(shù):

          set from=acc@163.com  #發(fā)送方 set smtp=smtp.163.com set smtp-auth-user=acc@163.com #賬號(hào) set smtp-auth-password=password #授權(quán)碼 set smtp-auth=login

          3.命令行發(fā)送郵件測(cè)試

          echo "測(cè)試郵件" | mail -s '請(qǐng)?jiān)诿魈煜挛缏?lián)系我' 111@qq.com

          此時(shí)在PHP腳本中調(diào)用mail函數(shù),會(huì)返回false,打開錯(cuò)誤日志,顯示:

          May 23 13:09:26 localhost sendmail[3901]: NOQUEUE: SYSERR(php-fpm): /etc/mail/sendmail.cf: line 0: cannot open: Permission denied

          因?yàn)槲覀冞€沒(méi)開啟對(duì)于httpd發(fā)送郵件的支持

          4.開啟httpd發(fā)送郵件支持

          setsebool -P httpd_can_sendmail 1

          5.假如出現(xiàn)dsn:service unavailable錯(cuò)誤,需要修改hostname

          hostname <hostname> #假如是本地服務(wù)器,嘗試設(shè)置為本地IP地址

          推薦學(xué)習(xí):php視頻教程

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)