The sendmail configuration method of the phpmail function under iis (officially recommended ). First, download the sendmail.zip file from glob.com.ausendmail. click here to download it and decompress it to the directory D: phpsendmail. Then open the php. ini file. first you need to go to.
Open the php. ini file and find the following code:
The code is as follows:
[Mail function]
; For Win32 only.
SMTP = localhost
Smtp_port = 25
; For Win32 only.
; Sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail-t-I ").
; Sendmail_path = ""
; Force the addition of the specified parameters to be passed as extra parameters
; To the sendmail binary. These parameters will always replace the value
; The 5th parameter to mail (), even in safe mode.
; Mail. force_extra_parameters =
By default, the local machine is used as the mail server. here we need to use sendmail to send mails. sendmail is used for configuration, such as sending via qq or 163 email addresses (generally in this way) therefore, we need to cancel all the options, that is, add ";" before SMTP = localhost and smtp_port = 25, and then delete sendmai_path = "" before, change to sendmai_path = "d: \ php \ sendmail \ sendmail.exe-t ".
The code is as follows:
[Mail function]
; For Win32 only.
; SMTP = localhost
; Smtp_port = 25
; For Win32 only.
; Sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail-t-I ").
Sendmail_path = "d: \ php \ sendmail \ sendmail.exe-t"
; Force the addition of the specified parameters to be passed as extra parameters
; To the sendmail binary. These parameters will always replace the value
; The 5th parameter to mail (), even in safe mode.
; Mail. force_extra_parameters =
Note that you only need to enable sendmail_path and save
Next, modify the sendmail. ini file in the sendmail directory, which includes the following content:
The code is as follows:
Smtp_server = smtp server address (for example, smtp.ym.163.com)
Auth_username = mailbox login name (such as info@xxxx.com)
Auth_password = email password (for example, xxxxxx)
Force_sender = sender address full write (such as info@xxxx.com)
There is another
The code is as follows:
; Auto = use SSL for port 465, otherwise try to use TLS
Delete the previous ";", that is, enable the SSL secure logon option.
After the preceding four items are correctly filled in, save the changes and restart IIS to make them ready for use.
If the email cannot be sent, check whether the port is blocked and whether mcafee has set email sending prohibition.
Bytes. Open the php. ini file...