php sendmail function 主機寄信時,如何正確指定寄件人mailaddress

使用php sendmail function 由主機寄信時,如何正確指定寄件人mailaddress

修改php.ini的設定檔,在設定檔中找到 mail function 的設定區塊

[mail function]
; For Win32 only. 適用windowns作業系統
SMTP = localhost
smtp_port = 25

; For Win32 only. 適用windowns作業系統
;sendmail_from =

; For Unix only. You may supply arguments as well (default: “sendmail -t -i"). 適用unix的作業系統
;預設sendmail 它所帶的參數只有 -t -i ,那我只要加上 -r from@email.address主機就會以from@email.address這個email寄出
sendmail_path = /usr/sbin/sendmail -t -i -r from@email.address

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =


在下方填入你的資料或按右方圖示以社群網站登入: Logo

You are commenting using your account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )


You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s