Hi. I'm using Microsoft Windows Web Server 2008 R2. I have setup IIS7.5, PHP 5.2 and Mysql Enterprise Edition 5.5 successfuly. The problem I'm having now is getting the SMTP server to work. Using the code:
Code:
<?php
$to="";
$from="";
$subject="Contact";
$message="Nume: $_POST[name]
Email: $_POST[mail]
Mesaj: $_POST[msg]";
if(mail($to, $subject, $message, $from))
    {header("Location: site.html");}
else
    {echo ("Mail could not be sent.<br><br>
    <a href='site.html'>HOME</a>");}
?>
writes in the log entries that everything is ok
HELO 250
MAIL 250
RCPT 250
DATA 250
QUIT 240
and creates the mail in the queue folder, but doesn't send it (it gets stuck in the queue).
Using the code:
Code:
<?php
$to = '';
$subject = 'TEST mail';
$message = 'Hello. This is a test email from me.';
$headers  = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/plain; ' . "
";
$headers .= 'To: Rudolf <>' . "
";
$headers .= 'From: Contact <>' . "
";
mail($to, $subject, $message, $headers);
?>
writes the same log entries (everything ok) but creates the mail in either BadMail or in queue (in which case the mail sits there for a few minutes then disappears, but nothing reaches the recipient) or doesn't create a mail at all (but the log entries are always consistent).

I have granted permisions in Connection to 127.0.0.1 and in Relay to 127.0.0.1 and localhost. I have allowed port forwarding on my router on port 25 and my ISP isn't blocking port 25.

Any idea why this might be happening and how to solve it? Thank you in advance. Bye.