Jump to content

Recommended Posts

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:

<?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:

<?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.

Link to comment
https://forums.phpfreaks.com/topic/233696-iis6-smtp-server-not-working/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.