Send mail configuration method of php mail function under iis

  
                  

A lot of discuz friends who use the online email function, but tested the "sendmail send via PHP function (recommended this way)" is not useful, because I am using the iis+php environment. So, let's get a tutorial that teaches you to configure sendmail on your own server

First you need to download the sendmail.zip file from http://glob.com.au/sendmail/and unzip it. Go to the 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 = [email protected]
    ; For Unix only. You may supply arguments as well (default: ”sendmail -t -i&rdquo ;).
  • ; 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 mail, use sendmail to configure the use of qq, 163 mailbox to send (usually in this way) so we need to log out all options, ie SMTP = localhost and smtp_port = 25 in front of “;” then put sendmai_path=" "The previous “;” deleted, changed to sendmai_path="d:\\php\\sendmail\\sendmail.exe -t", after the change is

     [mail function] 
  • ; For Win32 only.
    ;SMTP = localhost
  • ;smtp_port = 25
    ; For Win32 only.
  • ;sendmail_from = [email protected]
  • sendmail_path = ”d:\\php\\sendmail\\sendmail.exe -t" Force; addition the same 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 then modify the sendmail.ini file in the sendmail directory. The main content is the following

     smtp_server=smtp server address (such as smtp.ym.163.com) 
  • Auth_username=Mailbox login name (eg [email protected])
    auth_password=Mailbox password (eg xxxxxx)
  • force_sender=Sender address is written (eg [email protected])
    < Br>

    There is another

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

    Remove the previous “;” SSL secure login option can be

    The above four items are correctly filled out and saved, and then restarted IIS to be used normally.

  • Copyright © Windows knowledge All Rights Reserved