iis php mail function sendmail configuration method of official recommendation

  • 2020-05-16 06:32:12
  • OfStack

First, you need to first come from http: / / glob com. au/sendmail/download sendmail zip file, may click here to download oh, then put it into as D: \ php \ sendmail \ directory.

Then open the php.ini file and find the following code
 
[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 of 
; the 5th parameter to mail(), even in safe mode. 
;mail.force_extra_parameters = 

By default, this is the native mail server, so we need to use sendmail to send mail, and sendmail to configure qq and 163 to send mail (1 is usually in this way), so we need to log out all the options, SMTP = localhost and smtp_port = 25 with ";"; sendmai_path=";" sendmai_path="d:\php\sendmail\ sendmail.exe-t ", and then sendmai_path="d:\php\sendmail\ sendmail.exe-t"
 
[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 of 
; the 5th parameter to mail(), even in safe mode. 
;mail.force_extra_parameters = 

Note that just turn on sendmail_path and save

Then, modify the sendmail.ini file in the sendmail directory, and fill in the following items
 
smtp_server=smtp Server address ( Such as  smtp.ym.163.com) 
auth_username= Email login name ( Such as  info@xxxx.com) 
auth_password= Your password ( Such as  xxxxxx) 
force_sender= Write the sender's address in full ( Such as  info@xxxx.com) 

There's one more term
 
; auto = use SSL for port 465, otherwise try to use TLS 

Put the ";" in front. Delete, that is, turn on the SSL secure login option

The above four items can be saved after the correct filling and modification is completed, and then the IIS can be restarted for normal use.

If you can't send emails, check whether the port is blocked, whether mcafee is set to prohibit sending emails, etc

Related articles: