I have this code:
<?php
$to = $_GET['to'];
$from = $_GET['from'];
$subject = $_GET['subject'];
$body = $_GET['body'];
$headers = "From: $from";
$to = explode( ", ", $to );
foreach ( $to as $SendTo )
{
mail( $SendTo, $subject, $body, $headers );
print( "Mailed to $SendTo<br />\n" );
}
?>
When I try and execute it, I get this error:
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:\wamp\www\scripts\mail.php on line 12
My INI file looks like this:
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = jBrandt369@jComp.com
I thought that SMTP didn't need any extra software, but I guess it does.
Since Window's version of sendmail is overpriced garbage, what should I get, and how do I make it start automatically with Apache / PHP ?