5
50295
Hi!
I'm trying to get this short email script to work:
####################################################
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::SMTP;
use Net:OP3;
my $mailhost = "smtp.mail.net";
my $mailobj = "";
if($mailobj = Net::SMTP->new($mailhost, Timeout=>10, Debug=>0)){
print("Connected to $mailhost\n");
} else {
print("Could not connect to $mailhost\n");
die;
}
my $username = "nobody\@mail.net";
my $password = "secret";
my $Rx1 = "invisible\@email.net";
my $Rx2 = "nonsense\@web.net";
my $from = "nobody\@mail.net";
$mailobj->mail($from);
$mailobj->recipient($Rx1, $Rx2,{SkipBad=>1});
if($mailobj->data()){
$mailobj->datasend("To:$Rx1\r\n");
$mailobj->datasend("cc:$Rx2\r\n");
$mailobj->datasend("Subject: Email from Perl script using web.de
with authentication\r\n");
$mailobj->datasend("This is a test message\n");
print("Data sent successfully \n");
} else {
print("Send failed\n");
}
$mailobj->dataend() ;
$mailobj->quit;
#################################
It works fine on WinXP but fails on Linux Redhat with the following
error:
Can't locate Authen/SASL.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
/usr/lib/perl5/5.8.0/Net/SMTP.pm line 101.
What can I do about this error?
Thanks,
- Olumide
I'm trying to get this short email script to work:
####################################################
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::SMTP;
use Net:OP3;
my $mailhost = "smtp.mail.net";
my $mailobj = "";
if($mailobj = Net::SMTP->new($mailhost, Timeout=>10, Debug=>0)){
print("Connected to $mailhost\n");
} else {
print("Could not connect to $mailhost\n");
die;
}
my $username = "nobody\@mail.net";
my $password = "secret";
my $Rx1 = "invisible\@email.net";
my $Rx2 = "nonsense\@web.net";
my $from = "nobody\@mail.net";
$mailobj->mail($from);
$mailobj->recipient($Rx1, $Rx2,{SkipBad=>1});
if($mailobj->data()){
$mailobj->datasend("To:$Rx1\r\n");
$mailobj->datasend("cc:$Rx2\r\n");
$mailobj->datasend("Subject: Email from Perl script using web.de
with authentication\r\n");
$mailobj->datasend("This is a test message\n");
print("Data sent successfully \n");
} else {
print("Send failed\n");
}
$mailobj->dataend() ;
$mailobj->quit;
#################################
It works fine on WinXP but fails on Linux Redhat with the following
error:
Can't locate Authen/SASL.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
/usr/lib/perl5/5.8.0/Net/SMTP.pm line 101.
What can I do about this error?
Thanks,
- Olumide