Mod_Perl and Net::SMTP

Mod_Perl and Net::SMTP

am 30.09.2008 23:57:50 von Guy Alston

--____ULBABNQDGHYGSLPKTGWY____
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

I have a Netware server 6.5 sp6 with Apache 2.0.59. I am trying to use =
some perl scripts to send HTML form data back to a particular e-mail =
address. The scripts work on my workstation with my active perl but fail =
running on the server.

Error message:=20
Can't call method "mail" on an undefined value at sys:/perl/web/mailtest2.p=
l line 6.

It's always a line containing " $smtp =3D Net::SMTP->new("smtpserver")

I tried many different scripts but it always seems to be a problem around =
the object utilizing "Net::SMTP;. Is there a known issue with this. My =
version of MOD_PERL is 1.01.00
--____ULBABNQDGHYGSLPKTGWY____
Content-Type: multipart/related; boundary="____RIRZTZLJCYFGCQXCFUYL____"


--____RIRZTZLJCYFGCQXCFUYL____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


">


I have a Netware server 6.5 sp6 with Apache 2.0.59.  I am =
trying to use some perl scripts to send HTML form data back to a particular=
e-mail address.  The scripts work on my workstation with my active =
perl but fail running on the server.

 

Error message:
Can't call method "mail" on an undefined value at =
sys:/perl/web/mailtest2.pl line 6.

 

It's always a line containing " $smtp =3D Net::SMTP->new("smtpserve=
r")

 

I tried many different scripts but it always seems to be a problem =
around the object  utilizing "Net::SMTP;.  Is there a known =
issue with this. My version of MOD_PERL is 1.01.00

 

--____RIRZTZLJCYFGCQXCFUYL____--

--____ULBABNQDGHYGSLPKTGWY____--

Re: Mod_Perl and Net::SMTP

am 03.10.2008 16:34:12 von Philip Gollucci

Guy Alston wrote:
Error message:
> Can't call method "mail" on an undefined value at
> sys:/perl/web/mailtest2.pl line 6.
>
> It's always a line containing " $smtp = Net::SMTP->new("smtpserver")

Net::SMTP is known to work, though I'm not currently using it.
You could add

local $SIG{__WARN__} = \&Carp::cluck;
local $SIG{__DIE__} = \&Carp::confess;

This will help tell you where in Net::SMTP you are having a problem.

Once you know that, you can try to fix it.

OR this works --

use MIME::Lite ();

sub email {
my %args = @_;

my $email = MIME::Lite->new( Type => 'multipart/mixed' );

$email->add(To => $args{to});
$email->add(BCC => $args{bcc});
$email->add(From => $args{from});
$email->add(Subject => $args{subject});

$email->attach(Type => "TEXT", Data => $args{data});

MIME::Lite->send('smtp', SMTP_HOST, Timeout => 5);

eval { $email->send };

return $@;
}


>
> I tried many different scripts but it always seems to be a problem
> around the object utilizing "Net::SMTP;. Is there a known issue with
> this. My version of MOD_PERL is 1.01.00

Was I even alive when this version of mod_perl was out ?

Given that, more importantly, what version of perl are you using ?

Re: Mod_Perl and Net::SMTP

am 16.10.2008 23:19:33 von Guy Alston

--____JITDIVICTTJDMXZAAIQP____
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

First of all thanks to everyone who has responded. I've run a few more =
test and the problem is clearly around "MOD_Perl". I've load an SMTP =
server on the same system where I'm running the apache server and the =
scripts fail to establish a session.
I'm able to run those scripts same scripts successfully from the console =
using the Netware Perl Interpreter. Both the Apache MOD_PERL and Netware =
NLM are 5.8.4 version of Perl. I'm running apache 2.0.59. on Netware =
6.5 sp6.





>>> Philip M. Gollucci 10/3/2008 10:34:12 AM >>>

Guy Alston wrote:
Error message:
> Can't call method "mail" on an undefined value at=20
> sys:/perl/web/mailtest2.pl line 6.
> =20
> It's always a line containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is known to work, though I'm not currently using it.
You could add

local $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__} =3D \&Carp::confess;

This will help tell you where in Net::SMTP you are having a problem.

Once you know that, you can try to fix it.

OR this works --

use MIME::Lite ();

sub email {
my %args =3D @_;

my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' );

$email->add(To =3D> $args{to});
$email->add(BCC =3D> $args{bcc});
$email->add(From =3D> $args{from});
$email->add(Subject =3D> $args{subject});

$email->attach(Type =3D> "TEXT", Data =3D> $args{data});

MIME::Lite->send('smtp', SMTP_HOST, Timeout =3D> 5);

eval { $email->send };

return $@;
}


> =20
> I tried many different scripts but it always seems to be a problem=20
> around the object utilizing "Net::SMTP;. Is there a known issue =
with=20
> this. My version of MOD_PERL is 1.01.00

Was I even alive when this version of mod_perl was out ?

Given that, more importantly, what version of perl are you using ?
--____JITDIVICTTJDMXZAAIQP____
Content-Type: multipart/related; boundary="____VBPHQTPKAIUFLRMKMOER____"


--____VBPHQTPKAIUFLRMKMOER____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


">


First of all thanks to everyone who has responded.  I've run a =
few more test and the problem is clearly around "MOD_Perl". I've load an =
SMTP server on the same system where I'm running the apache server and the =
scripts fail to establish a session.

I'm able to run those scripts same scripts successfully from the =
console using the Netware Perl Interpreter. Both the Apache MOD_PERL and =
Netware NLM are 5.8.4  version of Perl.  I'm running apache =
2.0.59.  on Netware 6.5 sp6.

 

 

 

 

 

>>> Philip M. Gollucci<pgollucci@p6m7g8.com> 10/3/2008 =
10:34:12 AM >>>

Guy Alston wrote:
  Error message: >> Can't call method "mail" on an undefined value at
> sys:/perl/=
web/mailtest2.pl line 6.

> It's always a line =
containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is =
known to work, though I'm not currently using it.
You could add

l=
ocal $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__}  =
=3D \&Carp::confess;

This will help tell you where in Net::SMTP =
you are having a problem.

Once you know that, you can try to fix =
it.

OR this works --

use MIME::Lite ();

sub email =
{
     my %args =3D @_;

   &nb=
sp; my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' =
);

     $email->add(To    =
;  =3D> $args{to});
     $email->add(BCC&=
nbsp;    =3D> $args{bcc});
     =
$email->add(From    =3D> $args{from});
  =
   $email->add(Subject =3D> $args{subject});

 &=
nbsp;   $email->attach(Type =3D> "TEXT", Data =3D> =
$args{data});

     MIME::Lite->send('smtp', =
SMTP_HOST, Timeout =3D> 5);

     eval { =
$email->send };

     return $@;
}

<=
BR>> 
> I tried many different scripts but it always seems =
to be a problem
> around the object  utilizing "Net::SMTP;.&nbs=
p; Is there a known issue with
> this. My version of MOD_PERL is =
1.01.00

Was I even alive when this version of mod_perl was out =
?

Given that, more importantly, what version of perl are you using =
?








--____VBPHQTPKAIUFLRMKMOER____--

--____JITDIVICTTJDMXZAAIQP____--

Re: Mod_Perl and Net::SMTP

am 17.10.2008 02:54:50 von Guy Alston

--____RJJPWTNDSQSPTZASYVRD____
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

Got it working after updating UPDATING TCPIP stack. I have noticed after =
I do a few operations or process a form with a fair amount of data I start =
getting this error :

Failed to open SMTP connection: Inappropriate I/O control operation=20

Could this be some sort of Buffer issue. Here is a small piece of test =
code I'm using to work on the problem :

#!/usr/bin/perl
use Net::SMTP;
#Create a new object with 'new'.
$smtp =3D Net::SMTP->new("10.102.10.74");
if ( ! $smtp ) {
die "Failed to open SMTP connection: ", $!, "\n";
}

#Send the MAIL command to the server.
$smtp->mail("user\@sombody.com");
#Send the server the 'Mail To' address.
$smtp->to("user\@somewhere.net");
#Start the message.
$smtp->data();
#Send the message.
$smtp->datasend("Subject: Console test Post tcp update Very Very Cruel =
World!\n\n");
$smtp->datasend("\n\n");
$smtp->datasend("Good bye Cruel World!\n\n");
#End the message.
$smtp->dataend();
#Close the connection to your server.
$smtp->quit();

>>> Guy Alston 10/16/2008 5:19:33 PM >>>

First of all thanks to everyone who has responded. I've run a few more =
test and the problem is clearly around "MOD_Perl". I've load an SMTP =
server on the same system where I'm running the apache server and the =
scripts fail to establish a session.
I'm able to run those scripts same scripts successfully from the console =
using the Netware Perl Interpreter. Both the Apache MOD_PERL and Netware =
NLM are 5.8.4 version of Perl. I'm running apache 2.0.59. on Netware =
6.5 sp6.





>>> Philip M. Gollucci 10/3/2008 10:34:12 AM >>>

Guy Alston wrote:
Error message:
> Can't call method "mail" on an undefined value at=20
> sys:/perl/web/mailtest2.pl line 6.
> =20
> It's always a line containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is known to work, though I'm not currently using it.
You could add

local $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__} =3D \&Carp::confess;

This will help tell you where in Net::SMTP you are having a problem.

Once you know that, you can try to fix it.

OR this works --

use MIME::Lite ();

sub email {
my %args =3D @_;

my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' );

$email->add(To =3D> $args{to});
$email->add(BCC =3D> $args{bcc});
$email->add(From =3D> $args{from});
$email->add(Subject =3D> $args{subject});

$email->attach(Type =3D> "TEXT", Data =3D> $args{data});

MIME::Lite->send('smtp', SMTP_HOST, Timeout =3D> 5);

eval { $email->send };

return $@;
}


> =20
> I tried many different scripts but it always seems to be a problem=20
> around the object utilizing "Net::SMTP;. Is there a known issue =
with=20
> this. My version of MOD_PERL is 1.01.00

Was I even alive when this version of mod_perl was out ?

Given that, more importantly, what version of perl are you using ?
--____RJJPWTNDSQSPTZASYVRD____
Content-Type: multipart/related; boundary="____QDMTBFDOQDKWGRBSWIVB____"


--____QDMTBFDOQDKWGRBSWIVB____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


">


Got it working after updating UPDATING TCPIP stack.  I have =
noticed after I do a few operations or process a form with a fair amount =
of data I start getting this error :

 

Failed to open SMTP connection: Inappropriate I/O control operation =

 

Could this be some sort of Buffer issue.  Here is a small piece =
of test code I'm using to work on the problem :

 

#!/usr/bin/perl
use Net::SMTP;
  #Create a new object with =
'new'.
  $smtp =3D Net::SMTP->new("10.102.10.74");
if ( ! =
$smtp ) {
   die "Failed to open SMTP connection: ", $!, =
"\n";
}

 

  #Send the MAIL command to the server.
  $smtp->mail(=
"user\@sombody.com");
  #Send the server the 'Mail To' address.
=
  $smtp->to("user\@somewhere.net");
  #Start the message. R>  $smtp->data();
  #Send the message.
  =
$smtp->datasend("Subject: Console test Post tcp update Very Very Cruel =
World!\n\n");
  $smtp->datasend("\n\n");
  $smtp->dat=
asend("Good bye Cruel World!\n\n");
  #End the message.
  =
$smtp->dataend();
  #Close the connection to your server.
&nb=
sp; $smtp->quit();

>>> Guy Alston<sirguy@kernan.umm.e=
du> 10/16/2008 5:19:33 PM >>>


First of all thanks to everyone who has responded.  I've run a =
few more test and the problem is clearly around "MOD_Perl". I've load an =
SMTP server on the same system where I'm running the apache server and the =
scripts fail to establish a session.

I'm able to run those scripts same scripts successfully from the =
console using the Netware Perl Interpreter. Both the Apache MOD_PERL and =
Netware NLM are 5.8.4  version of Perl.  I'm running apache =
2.0.59.  on Netware 6.5 sp6.

 

 

 

 

 

>>> Philip M. Gollucci<pgollucci@p6m7g8.com> 10/3/2008 =
10:34:12 AM >>>

Guy Alston wrote:
  Error message: >> Can't call method "mail" on an undefined value at
> sys:/perl/=
web/mailtest2.pl line 6.

> It's always a line =
containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is =
known to work, though I'm not currently using it.
You could add

l=
ocal $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__}  =
=3D \&Carp::confess;

This will help tell you where in Net::SMTP =
you are having a problem.

Once you know that, you can try to fix =
it.

OR this works --

use MIME::Lite ();

sub email =
{
     my %args =3D @_;

   &nb=
sp; my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' =
);

     $email->add(To    =
;  =3D> $args{to});
     $email->add(BCC&=
nbsp;    =3D> $args{bcc});
     =
$email->add(From    =3D> $args{from});
  =
   $email->add(Subject =3D> $args{subject});

 &=
nbsp;   $email->attach(Type =3D> "TEXT", Data =3D> =
$args{data});

     MIME::Lite->send('smtp', =
SMTP_HOST, Timeout =3D> 5);

     eval { =
$email->send };

     return $@;
}

<=
BR>> 
> I tried many different scripts but it always seems =
to be a problem
> around the object  utilizing "Net::SMTP;.&nbs=
p; Is there a known issue with
> this. My version of MOD_PERL is =
1.01.00

Was I even alive when this version of mod_perl was out =
?

Given that, more importantly, what version of perl are you using =
?








--____QDMTBFDOQDKWGRBSWIVB____--

--____RJJPWTNDSQSPTZASYVRD____--

Re: Mod_Perl and Net::SMTP

am 17.10.2008 03:00:42 von Guy Alston

--____EOKQDCVOIDHXNLHDONKL____
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

I got it to work after upgrading the TCP/IP stack. It works for awhile =
but after processing a few forms I get the following:

Failed to open SMTP connection: Inappropriate I/O control operation=20

Here's some test code I'm using to diagnose the problem.


#!/usr/bin/perl
use Net::SMTP;
#Create a new object with 'new'.
$smtp =3D Net::SMTP->new("10.102.10.74");
if ( ! $smtp ) {
die "Failed to open SMTP connection: ", $!, "\n";
}

#Send the MAIL command to the server.
$smtp->mail("user\@sombody.com");
#Send the server the 'Mail To' address.
$smtp->to("user\@somewhere.com");
#Start the message.
$smtp->data();
#Send the message.
$smtp->datasend("Subject: Console test Post tcp update Very Very Cruel =
World!\n\n");
$smtp->datasend("\n\n");
$smtp->datasend("Good bye Cruel World!\n\n");
#End the message.
$smtp->dataend();
#Close the connection to your server.
$smtp->quit();

>>> Guy Alston 10/16/2008 5:19 PM >>>

First of all thanks to everyone who has responded. I've run a few more =
test and the problem is clearly around "MOD_Perl". I've load an SMTP =
server on the same system where I'm running the apache server and the =
scripts fail to establish a session.
I'm able to run those scripts same scripts successfully from the console =
using the Netware Perl Interpreter. Both the Apache MOD_PERL and Netware =
NLM are 5.8.4 version of Perl. I'm running apache 2.0.59. on Netware =
6.5 sp6.





>>> Philip M. Gollucci 10/3/2008 10:34:12 AM >>>

Guy Alston wrote:
Error message:
> Can't call method "mail" on an undefined value at=20
> sys:/perl/web/mailtest2.pl line 6.
> =20
> It's always a line containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is known to work, though I'm not currently using it.
You could add

local $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__} =3D \&Carp::confess;

This will help tell you where in Net::SMTP you are having a problem.

Once you know that, you can try to fix it.

OR this works --

use MIME::Lite ();

sub email {
my %args =3D @_;

my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' );

$email->add(To =3D> $args{to});
$email->add(BCC =3D> $args{bcc});
$email->add(From =3D> $args{from});
$email->add(Subject =3D> $args{subject});

$email->attach(Type =3D> "TEXT", Data =3D> $args{data});

MIME::Lite->send('smtp', SMTP_HOST, Timeout =3D> 5);

eval { $email->send };

return $@;
}


> =20
> I tried many different scripts but it always seems to be a problem=20
> around the object utilizing "Net::SMTP;. Is there a known issue =
with=20
> this. My version of MOD_PERL is 1.01.00

Was I even alive when this version of mod_perl was out ?

Given that, more importantly, what version of perl are you using ?
--____EOKQDCVOIDHXNLHDONKL____
Content-Type: multipart/related; boundary="____FITFTANXELBLYHOLQARL____"


--____FITFTANXELBLYHOLQARL____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


">


I got it to work after upgrading the TCP/IP stack.  It works for =
awhile but after processing a few forms I get the following:

 

Failed to open SMTP connection: Inappropriate I/O control operation =

 

Here's some test code I'm using to diagnose the problem.

 

 

#!/usr/bin/perl
use Net::SMTP;
  #Create a new object with =
'new'.
  $smtp =3D Net::SMTP->new("10.102.10.74");
if ( ! =
$smtp ) {
   die "Failed to open SMTP connection: ", $!, =
"\n";
}

 

  #Send the MAIL command to the server.
  $smtp->mail(=
"user\@sombody.com");
  #Send the server the 'Mail To' address.
=
  $smtp->to("user\@somewhere.com");
  #Start the message. R>  $smtp->data();
  #Send the message.
  =
$smtp->datasend("Subject: Console test Post tcp update Very Very Cruel =
World!\n\n");
  $smtp->datasend("\n\n");
  $smtp->dat=
asend("Good bye Cruel World!\n\n");
  #End the message.
  =
$smtp->dataend();
  #Close the connection to your server.
&nb=
sp; $smtp->quit();

>>> Guy Alston<sirguy@kernan.umm.e=
du> 10/16/2008 5:19 PM >>>


First of all thanks to everyone who has responded.  I've run a =
few more test and the problem is clearly around "MOD_Perl". I've load an =
SMTP server on the same system where I'm running the apache server and the =
scripts fail to establish a session.

I'm able to run those scripts same scripts successfully from the =
console using the Netware Perl Interpreter. Both the Apache MOD_PERL and =
Netware NLM are 5.8.4  version of Perl.  I'm running apache =
2.0.59.  on Netware 6.5 sp6.

 

 

 

 

 

>>> Philip M. Gollucci<pgollucci@p6m7g8.com> 10/3/2008 =
10:34:12 AM >>>

Guy Alston wrote:
  Error message: >> Can't call method "mail" on an undefined value at
> sys:/perl/=
web/mailtest2.pl line 6.

> It's always a line =
containing " $smtp =3D Net::SMTP->new("smtpserver")

Net::SMTP is =
known to work, though I'm not currently using it.
You could add

l=
ocal $SIG{__WARN__} =3D \&Carp::cluck;
local $SIG{__DIE__}  =
=3D \&Carp::confess;

This will help tell you where in Net::SMTP =
you are having a problem.

Once you know that, you can try to fix =
it.

OR this works --

use MIME::Lite ();

sub email =
{
     my %args =3D @_;

   &nb=
sp; my $email =3D MIME::Lite->new( Type =3D> 'multipart/mixed' =
);

     $email->add(To    =
;  =3D> $args{to});
     $email->add(BCC&=
nbsp;    =3D> $args{bcc});
     =
$email->add(From    =3D> $args{from});
  =
   $email->add(Subject =3D> $args{subject});

 &=
nbsp;   $email->attach(Type =3D> "TEXT", Data =3D> =
$args{data});

     MIME::Lite->send('smtp', =
SMTP_HOST, Timeout =3D> 5);

     eval { =
$email->send };

     return $@;
}

<=
BR>> 
> I tried many different scripts but it always seems =
to be a problem
> around the object  utilizing "Net::SMTP;.&nbs=
p; Is there a known issue with
> this. My version of MOD_PERL is =
1.01.00

Was I even alive when this version of mod_perl was out =
?

Given that, more importantly, what version of perl are you using =
?








--____FITFTANXELBLYHOLQARL____--

--____EOKQDCVOIDHXNLHDONKL____--