Send.pl hangs? Log Out | Topics | Search
Moderators | Register | Edit Profile

Add2it.com Discussions » Add2it Mailman Pro Support » Send.pl hangs? « Previous Next »

Author Message
 

Wayne Dempsey (pelicanparts)
New member
Username: pelicanparts

Post Number: 1
Registered: 08-2004
Posted From: 207.136.156.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 08:09 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Hey all. Installed the script tonite, but when I go to send an email, the script just hangs. The server eventually timesout, and when I go back to the send screen, it says that it didn't send, and asks if I would like to send it again.

I can't look at the code, so I can't figure out what the problem is (slightly annoying).

???

-Wayne
 

Wayne Dempsey (pelicanparts)
New member
Username: pelicanparts

Post Number: 2
Registered: 08-2004
Posted From: 207.136.156.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 08:10 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Also, when I go to add a user, and select "Send subscribe autoresponse to new subscriber?" - it hangs as well. It's obviously having a problem communicating with the SMTP server. I have the server setup properly to send mail, and have tested it from the same computer using Outlook.

No error messages - just a timeout?

-Wayne
 

Frank Bauer (support)
Moderator
Username: support

Post Number: 722
Registered: 03-2001
Posted From: 217.227.197.98


Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 10:27 am:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Hi Wayne,

Ok, as you told me via chat, the script and your companies IIS SMTP server didn't work for some reason together.

Would you like to share which SMTP server type worked for you in case another user with his own web server (not rented from a web host) has a similar problem?
Sincerely,

Frank Bauer

============================================================
 Would you like more... ?  Scripts & Service for Your Web Business
 http://www.add2it.com     ...Helping you succeed online...
============================================================
 

Wayne Dempsey (pelicanparts)
New member
Username: pelicanparts

Post Number: 3
Registered: 08-2004
Posted From: 207.136.156.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 03:51 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Well, I'm back at square one here. The old version of Software.com's Post.Office which I have running on one machine here at the office didn't install correction on this newer Win2K box.

I also tried using a different SMTP server on a different Win2K box - no good - the script didn't work either. Outlook and Netscape (and my other Perl & PHP scripts) run fine using the Windows SMTP server, but these scripts just hang when trying to access the server.

There's something in the script that's not working correctly with the Windows SMTP service. Right now, there's not too many options available to me to get this to work other than getting it to work with the standard Windows service. I've been working on this for 10 hours now, with no luck...

Need help...

-Wayne
 

Frank Bauer (support)
Moderator
Username: support

Post Number: 723
Registered: 03-2001
Posted From: 217.227.197.98


Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 05:36 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Hi Wayne,

You say that you have a Perl script there that works with the IIS SMTP server? If you like, I can look at the source code to see what is done differently there.

This way I could "teach" the Add2it script how to work with your SMTP server.

As we found out before, it's always stopping at the same point. Once the script sends the HELO command to the SMTP server, it waits and waits and never gets a reply.

What do you think? Would you like me to do that?
Sincerely,

Frank Bauer

============================================================
 Would you like more... ?  Scripts & Service for Your Web Business
 http://www.add2it.com     ...Helping you succeed online...
============================================================
 

Wayne Dempsey (pelicanparts)
Junior Member
Username: pelicanparts

Post Number: 6
Registered: 08-2004
Posted From: 207.136.156.68

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, August 31, 2004 - 10:19 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

This script usually works, but ironically, it's not working today on my machines:

$smtp_server = "192.168.100.99";
$this_server = "192.168.3.2";

$emailfrom = 'coupon@pelicanparts.com';
$recipient = 'wayne@pelicanparts.com';
$subject = 'Coupon Status Email';
$message = 'this is a test message';
&email;


####################################################################
# This smtp socket script was created by Johnny Hughes 4/25/98 #
# #
# http://ntperling.hypermart.net #
# #
# the below variables can come from a form...or be predefined... #
# or any combination thereof, as long as they are all defined #
# before the needed in the call below. This script is designed to #
# be place inside another script, and is not fully fuctional by #
# itself #
####################################################################

sub email {

($x,$x,$x,$x, $here) = gethostbyname($this_server);
($x,$x,$x,$x, $there) = gethostbyname($smtp_server);


$thisserver = pack('S n a4 x8',2,0,$here);
$remoteserver = pack('S n a4 x8',2,25,$there);
#NOTE, if Solaris, uncomment the line below and delete the one below it...leave alone for NT
#(!(socket(S,2,2,6))) && (&email_error("Connect error!"));
(!(socket(S,2,1,6))) && (&email_error("Connect error! socket"));
(!(bind(S,$thisserver))) && (&email_error("Connect error! bind"));
(!(connect(S,$remoteserver))) && (&email_error("!! connection to $smtp_server has failed!"));

select(S);
$| = 1;
select(STDOUT);

$DATA_IN = <s>;
($DATA_IN !~ /^220/) && (&email_error("data in Connect error - 220"));

print S "HELO $ENV{REMOTE_HOST}\r\n";
$DATA_IN = <s>;
($DATA_IN !~ /^250/) && (&email_error("data in Connect error - 250"));

print S "MAIL FROM:<$emailfrom>\n";
$DATA_IN = <s>;
($DATA_IN !~ /^250/) && (&email_error("'From' address not valid"));

print S "RCPT TO:<$recipient>\n";
$DATA_IN = <s>;
($DATA_IN !~ /^250/) && (&email_error("'Recipient' address not valid"));

print S "DATA\n";
$DATA_IN = <s>;
($DATA_IN !~ /^354/) && (&email_error("Message send failed - 354"));

print S <<MESSAGES;
From: $emailfrom
To: $recipient
Subject: $subject

$message
.
MESSAGES
$DATA_IN = <s>;
($DATA_IN !~ /^250/) && (&email_error("Message send failed - try again - 250"));

print S "QUIT\n";
# print "Content-type: text/html\n\n";
# print "<br>Email sucessfully sent\n";
}

sub email_error {
# Displays any errors and prints out FORM and ENV info.
print "Content-type: text/html\n\n";
print "Email Error:\n";
print "Message: $_[0]\n\n";
$Email_Error = "$_[0]";
#exit;
}
 

Frank Bauer (support)
Moderator
Username: support

Post Number: 727
Registered: 03-2001
Posted From: 217.93.34.210


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, September 01, 2004 - 02:08 pm:   Edit Post Delete Post View Post/Check IP Print Post    Move Post (Moderator/Admin Only)

Hi Wayne,

Both scripts use basically the same method of sending...

$AF_INET = 2;
$SOCK_STREAM = 1;
$SIG{'INT'} = 'dokill';
sub dokill { kill 9,$child if $child; }
$sockaddr = 'S n a4 x8';
($name,$aliases,$proto) = getprotobyname('tcp');
($name,$aliases,$config{'serverport'}) = getservbyname($config{'serverport'},'tcp') unless $config{'serverport'} =~ /^\d+$/;
($name,$aliases,$type,$len,$thisaddr) = gethostbyname($host_server);
($name,$aliases,$type,$len,$thataddr) = gethostbyname($config{'smtpserver'});
$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
$that = pack($sockaddr, $AF_INET, $config{'serverport'}, $thataddr);
$max_try = 2;
while(! socket(MAIL, PF_INET, SOCK_STREAM, getprotobyname('tcp')) && $max_try > 0) {
$max_try--;
}
if(! $max_try) { &arp_error("$txt{36} $! ($toemail)<p>$txt{31}: ARP-MS-SL1", $user); }
if (! bind(MAIL, $this) && !$dontbind) { &arp_error("$txt{37} $! ($this / $toemail)<p>$txt{31}: ARP-MS-SL2", $user); }
if (! connect(MAIL, $that)) { &arp_error("$txt{38} $! ($that / $toemail)<p>$txt{31}: ARP-MS-SL3", $user); }
select(MAIL);
$| = 1;
select(STDOUT);
$a=<mail>;
$mydomain = $config{'adminemail'} || $fromemail;
$mydomain =~ s/.+\@//;
print MAIL "HELO $mydomain$nml";
$a = <mail>;
&arp_error("$txt{54} $a ($toemail)<p>$txt{31}: ARP-MS-SL4", $user) if ! $a || $a =~ /^[45]/;
print MAIL "RSET$nml";
$a=<mail>;
print MAIL "MAIL FROM:<$fromemail>$nml";
$a=<mail>;
&arp_error("$txt{39} $a ($toemail)<p>$txt{31}: ARP-MS-SL5", $user) if ! $a || $a =~ /^[45]/;
if ($a =~ /^221/){ close(MAIL); &arp_error("$txt{40} $a ($toemail)<p>$txt{31}: ARP-MS-SL6", $user); }
print MAIL "RCPT TO:<$toemail>$nml";
$a=<mail>;
&arp_error("$txt{41} &lt;$toemail&gt;<br>$a<br>$txt{42} <a href="$config{">$txt{48}</a>.", $user) if ! $a || $a =~ /^[45]/;
if ($a =~ /^221/){ close(MAIL); &arp_error("$txt{40} $a ($toemail)<p>$txt{31}: ARP-MS-SL7", $user); }
print MAIL "DATA $nml";
$a=<mail>;
&arp_error("$txt{43} $a ($toemail)<p>$txt{31}: ARP-MS-SL8", $user) if ! $a || $a =~ /^[45]/;
if ($a =~ /^221/){ close(MAIL); &arp_error("$txt{40} $a ($toemail)<p>$txt{31}: ARP-MS-SL9", $user); }

The command that your server got stuck on was...

print MAIL "HELO $mydomain$nml";
Sincerely,

Frank Bauer

============================================================
 Would you like more... ?  Scripts & Service for Your Web Business
 http://www.add2it.com     ...Helping you succeed online...
============================================================

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image

Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: