How to configure sendmail for the php mail function in iis (officially recommended)

Source: Internet
Author: User

First, you need to first go to the slave Node.

Open the php. ini file and find the following code:Copy codeThe 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 ".Copy codeThe 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:Copy codeThe 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 anotherCopy codeThe 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.