简体   繁体   中英

PHP mail() NOT working on Windows (IIS)

Below is my source using the PHP mail function

$to = "you@domain.com";
$subject = "This is the subject line
$message = "This is the message"
$headers = 'From: no-reply@domain.com' . "\r\n" .
           'Reply-To: admin@domain.com' . "\r\n" .
           'X-Mailer: PHP/' . phpversion();
$result = mail($to , $subject , $message, $headers )

Below is my PHP config, which is running on Windows IIS

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com

To send mail you should configure smtp . IIS its just web server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM