Net::SMTP error: Can't locate Mail/Sender.pm in @INC

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::pOP3;


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
 
5

50295

Alexandre said:
try to install the module SASL.pm

$bash>cpan
cpan>install SASL


Problem is that I'm not the sys admin :-( . Is there another Perl
module that does mail sending with authentication?

Thanks,

- Olumide
 
5

50295

Alexandre said:
ou may try by using telnet or create a socket connection to the port 25
maybe if you can't install module, but I thing it will be better to ask
your sys admin to install it

The problem is with the authentication,
$mailobj->auth($username, $password);

Not the connecting to the smtp server. How can telnet or a socket
connection perfom authentication?

- Olumide
 
G

Gunnar Hjalmarsson

The subject line does not match the rest of the message.

Anyway, in a sub-thread in clpmisc you explained that you need to send
emails with authentication, so the Mail::Sender module is problably a
good tool. Install it, and follow the Mail::Sender documentation.

Btw, Mail::Sender is a plain Perl module, so if you can't install it the
regular way, you can just place Mail/Sender.pm in any suitable directory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Can't locate Expect.pm 1
duplicates in @INC 4
Can't locate POE.pm in @INC 3
Filename variable going away 5
Net::SMTP module error 5
SNMP.pm 4
Perl can't locate a .pm in @INC 7
Can't locate Term/ANSIColor.pm 0

Members online

No members online now.

Forum statistics

Threads
473,930
Messages
2,570,072
Members
46,522
Latest member
Mad-Ram

Latest Threads

Top