Click to See Complete Forum and Search --> : now it's smtp virtual server


discus
08-13-2005, 08:12 PM
Now, I've found my Default SMTP Virtual Server DOESN'T WORK properly too.

This script:
<html>
<head>
<title>Listing 10-5</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040">
<?
$form = "
<form action=\"listing10-5.php\" method=\"post\">
<input type=\"hidden\" name=\"seenform\" value=\"y\">
<b>Send us your comments!</b><br>
Your Name:<br>
<input type=\"text\" name=\"name\" size=\"20\" maxlength=\"20\" value=\"\"><br>
Your Email:<br>
<input type=\"text\" name=\"email\" size=\"20\" maxlength=\"40\" value=\"\"><br>
Your Comments:<br>
<textarea name=\"comments\" rows=\"3\" cols=\"30\"></textarea><br>
<input type=\"submit\" value=\"submit!\">
</form>
";
// If we haven't already seen the form ($seenform passed by hidden
// form value), show the form.
if ($seenform != "y") :
print "$form";
else :
// change $recipient to be the recipient of the form information
$recipient = "yourname@youremail.com";
// email subject
$subject = "User Comments ($name)";
// extra email headers
$headers = "From: $email";
// send the email or produce an error
mail($recipient, $subject, $comments, $headers) or die("Could not send
email!");
// send the user an appropriate message
print "Thank you $name for taking a moment to send us your comments!";
endif;
?>
</body>
</html>
sends no mail in the target folder C:\Inetpub\mailroot\Drop.

When I start the smtp virt. server, get the alert:'The service cannot accept control messages at this time. Check the Windows Event Viewer for details.', but the server seems running OK (no red mark on the icon, in the context menu 'start' is inactive & 'stop' is active).

There is no failure report of smtp service in the EventViewer, but just 2 informations(event descriptions):
'EventID:7035 The SMTP service was succesfully sent a start control'
'EventID:7036 The SMTP service entered the running state'

SMTP variable in the php.ini is set to localhost.

Should I do some configuration of Outlook Express even for my local domain ?


I'm getting so tired trying to make all little wheels spinning.


T

discus
08-14-2005, 01:23 PM
There is some progress.

This script:
<?
$to = "julie@thickbook.com";
$subject = "ZDNet Developer article";
$msg = "I completely understand SMTP servers now!";
$headers = "From: me@mycompany.com\r\nReply-To: someoneelse@mycompany.com";
mail("$to", "$subject", "$msg", "$headers");
echo "finished!";
?>
sends a mail, but in the Queue folder, not in the Drop.

Does anyone know why ?

(I've installed cdonts.dll - although don't know exactly why I did it and whether is it necessarlly?)

Previous script still doesn't work.

Genixdeae
08-14-2005, 01:39 PM
are you running IIS for XP Pro or 2k3 Server? because with 2k3 Server there is certain things you need to do(i found them after about a month of yelling and screaming at the server) but with XP Pro all you should need to do is install the SMTP Service

discus
08-15-2005, 06:27 PM
I'm running IIS 5.1 for XP pro, but I've resolved the confusion :)

If we want our mail to be sent to the Drop flder, it must be addressed to the local domain name, like john@localdomainname.

Unknown domain mails will be sent to the Queue folder.

As for my previous script, I also know why it doesn't work.

The hidden $seenform form variable is never set to 'y', so the mail messages are never sent.
Instead, a new form is created over and over again (on submit).

Well, does anybody know, what's the problem with hidden $seenform ?
:confused:




Thanks

discus
08-15-2005, 08:02 PM
:o Huh, the problem was actually solved in my previous topic (about register_globals), so, with register_globals turned 'on' (sorry, just for the testing), the script works fine.

Ok, this was amusing 1 man show :D


p.s. what is cdonts.dll used for, and can I remove it, in regards that I installed it just yesterday ?