【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】
標(biāo)題: 如何配置以及實現(xiàn)mail()函數(shù)的具體方法 [打印本頁]
作者: 學(xué)習(xí)NO.1 時間: 2016-1-10 12:11
標(biāo)題: 如何配置以及實現(xiàn)mail()函數(shù)的具體方法
總是喜歡用phpmailer插件來實現(xiàn)郵件發(fā)送,而從來沒有真正的在某個項目中采用php自帶的mail()函數(shù)來實現(xiàn)發(fā)送郵件的功能。今天剛好有項目需要,所以通過php自帶的mail()函數(shù)來實現(xiàn)項目中需要的發(fā)送郵件功能!
下載sendmail
在百度自行搜索sendmail軟件
解壓安裝包(最好和php同一個目錄下C:\websoft\)
(, 下載次數(shù): 32)
配置php.ini文件
- [mail function]
- ; For Win32 only.
- SMTP = smtp.jhonse.com
- smtp_port = 25
- ; For Win32 only.
- sendmail_from = service@jhonse.com
- ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
- sendmail_path = "C:\websoft\sendmail\sendmail.exe -t"
復(fù)制代碼
(, 下載次數(shù): 36)
配置sendmail.ini文件
- error_logfile=error.log
- ; create debug log as debug.log (defaults to same directory as sendmail.exe)
- ; uncomment to enable debugging
- debug_logfile=debug.log
- ; if your smtp server requires authentication, modify the following two lines
- auth_username=service@jhonse.com
- auth_password=123456
- ; if your smtp server uses pop3 before smtp authentication, modify the
- ; following three lines. do not enable unless it is required.
- pop3_server=
- pop3_username=
- pop3_password=
- ; force the sender to always be the following email address
- ; this will only affect the "MAIL FROM" command, it won't modify
- ; the "From: " header of the message content
- force_sender=service@jhonse.com
- ; force the sender to always be the following email address
- ; this will only affect the "RCTP TO" command, it won't modify
- ; the "To: " header of the message content
復(fù)制代碼
(, 下載次數(shù): 30)
說明: 第一次最好啟用debug.log_file,error_logfile,以查看sendmail是否生效。
重啟apache或者IIS
重啟之后,mail()函數(shù)就可以正常發(fā)送郵件了。
歡迎光臨 【道勤網(wǎng)】- bmrsportswear.com 軟件視頻自學(xué)教程|免費教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機械設(shè)計教程|網(wǎng)站設(shè)計教程!【道勤網(wǎng)】 (http://bmrsportswear.com/) |
Powered by Discuz! X3.4 |