以下是使用PHP邮件功能的源代码
$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 )
下面是我的PHP配置,它在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