Sendmail configuration method of php mail function under iis (official recommendation)_PHP tutorial

WBOY
Release: 2016-07-21 15:19:18
Original
1425 people have browsed it

First, you need to download the sendmail.zip file from http://glob.com.au/sendmail/. Click here to download it directly, and then unzip it to a directory such as D:phpsendmail.

Then open the php.ini file and find the following code

Copy the 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 of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

by default This machine is used as a mail server. Here we need to borrow sendmail to send mails. Use sendmail to configure e-mails such as qq and 163 to send (usually in this way), so we need to log out all options, that is, put Add ";" in front of SMTP = localhost and smtp_port = 25, then delete the ";" in front of sendmai_path="" and change it to sendmai_path="d:phpsendmailsendmail.exe -t". After the change, it is
Copy 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 = "d:phpsendmailsendmail.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 you only need to enable sendmail_path, then save

and continue Modify the sendmail.ini file in the sendmail directory. The main contents are as follows:
Copy the code The code is as follows:

smtp_server=smtp server address (such as smtp.ym.163.com)
auth_username=email login name (such as info@xxxx.com)
auth_password=email password (such as xxxxxx)
force_sender=sender Write the full address (such as info@xxxx.com)

There is also another item
Copy code The code is as follows:

; auto = use SSL for port 465, otherwise try to use TLS

Delete the ";" in front, that is, enable the SSL secure login option

Fill in the above four items correctly, save them after modification, and then restart IIS to use it normally.

If you cannot send emails, check whether the port is blocked, whether mcafee is set to prohibit sending emails, etc.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325318.htmlTechArticleFirst you need to download the sendmail.zip file from http://glob.com.au/sendmail/, Click here to download it directly, and then unzip it to a directory such as D:phpsendmail. Then open the php.ini file...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!