title: Why am I getting a "Failed to connect to mailserver" error in this email script?
body: <p>I have encountered an error:</p>
  
  <pre><code>Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\works\test\registration-code3.php on line 56
  </code></pre>
  
  <p>Here is my <code>php.ini</code>:</p>
  
  <pre><code>define_syslog_variables  = Off
  
  [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 = postmaster@localhost
  </code></pre>
  
  <p>How can I fix this?</p>