立即注冊 找回密碼

QQ登錄

只需一步,快速開始

iis下php mail函數(shù)的sendmail配置方法(官方推薦)

2015-4-18 11:31| 發(fā)布者: 學習NO.1| 查看: 575| 評論: 0|原作者: 學習NO.1

摘要: 很多玩discuz的彭友在使用在線發(fā)郵件的功能,但是測試了通過 PHP 函數(shù)的 sendmail 發(fā)送(推薦此方式)怎么都沒用,因為本人現(xiàn)在用的是iis+php環(huán)境,所以就出這么一個教程,教大家在自己服務器上配置sendmail 首先你需要先 ...
很多玩discuz的彭友在使用在線發(fā)郵件的功能,但是測試了"通過 PHP 函數(shù)的 sendmail 發(fā)送(推薦此方式)"怎么都沒用,因為本人現(xiàn)在用的是iis+php環(huán)境,所以就出這么一個教程,教大家在自己服務器上配置sendmail
首先你需要先到從http://glob.com.au/sendmail/下載sendmail.zip文件,點此可以直接下載噢,然后把它解壓到如D:\php\sendmail\目錄下。

然后打開php.ini文件,找到下面這段代碼


  1. [mail function]
  2. ; For Win32 only.
  3. SMTP = localhost
  4. smtp_port = 25
  5. ; For Win32 only.
  6. ;sendmail_from = me@example.com
  7. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  8. ; sendmail_path = ""
  9. ; Force the addition of the specified parameters to be passed as extra parameters
  10. ; to the sendmail binary. These parameters will always replace the value of
  11. ; the 5th parameter to mail(), even in safe mode.
  12. ;mail.force_extra_parameters =
復制代碼
默認情況下是以本機做為郵件服務器,這里我們需要借用sendmail來發(fā)送郵件,用sendmail來配置如用qq、163的郵箱來發(fā)送(一般都是以這種方式)所以我們需要把所有的選項都注銷,即把SMTP = localhost和smtp_port = 25前面加上";"然后把sendmai_path=""前面的";"刪掉,改為sendmai_path="d:\php\sendmail\sendmail.exe -t",改完后的即是


  1. [mail function]
  2. ; For Win32 only.
  3. ;SMTP = localhost
  4. ;smtp_port = 25
  5. ; For Win32 only.
  6. ;sendmail_from = me@example.com
  7. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  8. sendmail_path = "d:\php\sendmail\sendmail.exe -t"
  9. ; Force the addition of the specified parameters to be passed as extra parameters
  10. ; to the sendmail binary. These parameters will always replace the value of
  11. ; the 5th parameter to mail(), even in safe mode.
  12. ;mail.force_extra_parameters =
復制代碼
注意以上只需要開啟sendmail_path即可,然后保存

接著修改sendmail目錄下的sendmail.ini文件,主要填的內(nèi)容有以下幾項

  1. smtp_server=smtp服務器地址(如 smtp.ym.163.com)
  2. auth_username=郵箱登錄名(如 info@xxxx.com)
  3. auth_password=郵箱密碼(如 xxxxxx)
  4. force_sender=發(fā)件人地址全寫(如 info@xxxx.com)
復制代碼
另外還有一項

  1. ; auto = use SSL for port 465, otherwise try to use TLS
復制代碼
把前面的";"刪除,即開啟SSL安全登錄選項即可

以上四項正確填寫修改完成后保存,然后重啟IIS即可正常使用。

如果不能發(fā)送郵件,檢查下端口是不是被屏蔽了,mcafee是不是設置了禁止發(fā)送郵件等




鮮花

握手

雷人

路過

雞蛋

最新評論

相關推薦
!jz_fbzt! !jz_lxwm! !jz_gfqqq!

關于我們|手機版|小黑屋|地圖|【道勤網(wǎng)】-bmrsportswear.com 軟件視頻自學教程|免費教程|自學電腦|3D教程|平面教程|影視動畫教程|辦公教程|機械設計教程|網(wǎng)站設計教程【道勤網(wǎng)】 ( 皖ICP備15000319號-1 )

GMT+8, 2024-10-23 21:40

Powered by DaoQin! X3.4 © 2016-2063 Dao Qin & 道勤科技

返回頂部