These scripts both use to work.  But now they don't.  Both of them are for
sending e-mail.  I'm using Win2k Adv. Server.  I'm using IIS's default SMTP
server on a port number other than port 25 and I allow relaying through that
port.  Let's just say it's port 87654.  (Can you tell I'm paranoid?)  My
Exchange 5.5 is setup to work as normal.  I'm using perl in my CGI scripts
to generate e-mails throught IIS's SMTP server.  I'm not getting ANY error
messages from either of the scripts.  Both of them appear to be working
fine.  BUT, one BIG problem, the e-mails are never arriving!!  Hmmm....that
could be a show stopper.  Can anyone see anything at all in these
subroutines?  Is there another way to get feedback from these scripts to
find out what is going wrong?  This is what shows up in my log file for my
IIS SMTP server after I run the script:

23:30:00 66.17.229.218 HELO - 250
23:30:00 66.17.229.218 MAIL - 250
23:30:00 66.17.229.218 RCPT - 250
23:30:00 66.17.229.218 DATA - 250
23:30:00 66.17.229.218 QUIT - 0

I don't know if this is good or bad.

Here are my scripts.  Neither of them work but they use to work!

script 1=====================
use IO::Socket;

sub sendMail ($$$$)
{
my ($to,$from,$subject,$message) = @_;

my $remote = IO::Socket::INET->new(
                                        Proto => "tcp",
                                        PeerPort => "smtp(87654)",
                                        ) || die $!;

my $debug = <$remote>;
print $remote "MAIL FROM: $from\n";
$debug .= <$remote>;
print $remote "RCPT TO: $to\n";
$debug .= <$remote>;
print $remote "DATA\n";
$debug .= <$remote>;
print $remote "From: $from\nTo: $to\nSubject: $subject\n\n";
print $remote "$message\n";
print $remote ".\n";
$debug .= <$remote>;
close $remote;
return $debug;
}

my $errors =
(sendMail('me\@mydomain.com','me\@mydomain.com','test','testing'));

print "errors = $errors<br>\n";
print "message sent\n";
exit;
===========================

script 2===================
use Mail::Sendmail;

# Port number 87654 hardcoded in Sendmail.pm as smtp port
# Build the body of your message
my $body = <<HERE;

Testing

HERE

# The closing HERE must be on a line all by itself, with no
# whitespace in front of or after it
#Send the message
my %mail = ( To      => '[EMAIL PROTECTED]',
             From    => '[EMAIL PROTECTED]',
             Subject => 'testing',
             Message => $body );
sendmail(%mail) or die $Mail::Sendmail::error;

print "message sent\n";

exit;
=======================

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to