[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Net::SMTP timeout



Hello list,

I am making a simple html-email-form, making use of Macperl CGI. Using the
module Net::SMTP I am grabbing the variables from the html source, making an
smtp connection to a specific server, then send the variables and send back
some redirect code as a reply to the client. The first time I tried the
script, it worked very well (very slow, but AFAIK Mac is slow at looking up
domain-names and such, maybe this slows the script down, I dunno ...). Yet
after a few other tries I keep getting these timeout errors, which pop-up in
the browser. The email is sent correctly and all, just the reply-html isn't
sent out. Any idea's?
here's (most of) the script:

#!perl
use Net::SMTP;
use CGI;
$query = new CGI();

$mailto = $query->param('mailto');
...
$message = $query->param('message');
$message =~ s/\n//g;


$smtp = Net::SMTP->new('xxx');
$smtp->mail($mailto);
$smtp->to($mailto);
$smtp->data();
$smtp->datasend("From: xxx");
$smtp->datasend("Subject:\t\txxx\n\n");
...
$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;

print << "EOT";
HTTP/1.0 302 Found
Location: $resulturl



Content-type: text/html


<HTML>
<head>
                <meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
                <title>Reply</title>
</head>
<BODY><A HREF="$redirect">Click here ...</A></BODY>
</HTML>
EOT

__END__


Thanks!

Martijn Houtman


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org