mwhiting has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks. I'm back with another question. Maybe more like a repeat of a previous one.
I'm getting a message back from a Windows server when trying to run a script to send an email, which needs to authenticate before sending. I get the message: Cannot find a SASL Connection library at PERL2EXE_STORAGE/Net/SMTP.pm line 137 I had a previous post about ScanDeps to find dependencies. I got ScanDeps running (thanks to all who posted, I used the scandeps.pl script). It didn't show anything interesting that might be missing (I assume). The modules shown to be needed were:
'File::Spec' => '3.30', 'File::Spec::Win32' => '3.30', 'File::Spec::Unix' => '3.30', 'Cwd' => '3.30', 'CGI::Carp' => '3.45', 'Authen::SASL::EXTERNAL' => '0.99', 'Authen::SASL' => '2.12', 'Authen::SASL::Perl' => '1.07', 'Authen::SASL::Perl::ANONYMOUS' => '1.03', 'Authen::SASL::Perl::CRAM_MD5' => '1.03', 'Authen::SASL::Perl::DIGEST_MD5' => '1.07', 'Authen::SASL::Perl::EXTERNAL' => '1.03', 'Authen::SASL::Perl::GSSAPI' => '0.04', 'Authen::SASL::Perl::LOGIN' => '1.03', 'Authen::SASL::Perl::PLAIN' => '1.04', 'Authen::SASL::CRAM_MD5' => '0.99',
Here's the code. Note that I am using Perl2Exe to package it into an executable for Windows to run. With those dependencies listed about, what am I missing that would give the connection library error .... or better yet, what is it really referring to when it refers to a 'connection library'? Thanks a lot. I need to get this sorted out for a project I am working on.
#!/usr/bin/perl use warnings; use strict; #perl2exe_noopt "Opcode.pm" #perl2exe_exclude "Apache2/RequestRec.pm" #perl2exe_exclude "Apache2/RequestIO.pm" #perl2exe_exclude "Apache2/RequestUtil.pm" #perl2exe_exclude "APR/Pool.pm" #perl2exe_exclude "ModPerl/Util.pm" #perl2exe_exclude "Apache2/Response.pm" #Net::SMTP related: #perl2exe_exclude "Convert/EBCDIC.pm" #perl2exe_exclude "Mac/InternetConfig.pm" #perl2exe_include "Authen/SASL.pm" use CGI::Carp qw(fatalsToBrowser); &MakeRequest; exit; ############################################ sub MakeRequest { print "Content-type: text/html;charset=UTF-8\n\n"; print <<NCP; <html> <head> <title>Library Search</title> </head><body> NCP use Net::SMTP; use Authen::SASL; my $SMTPServer = 'myserver.net'; my $emailFrom = 'me@here.com'; my $emailTo = 'you@there.com'; my $user = 'username'; my $pass = 'password'; my $NetSMTP = Net::SMTP->new($SMTPServer, Port=>'587', Timeout=>60, +Debug=>1) || die "<br>Unable to open connection.<br>Error Message: $! +"; $NetSMTP->auth( user => $user, pass => $pass, ) || die "<br>Auth didn't work: $!<br>"; print "<br>sending from [$emailFrom] to [$emailTo]"; $NetSMTP->mail($emailFrom); $NetSMTP->to($emailTo); $NetSMTP->data(); $NetSMTP->datasend('this is the body text'); $NetSMTP->dataend(); $NetSMTP->quit; print "<br>Done."; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SASL connection library missing - help?
by marto (Cardinal) on Jul 19, 2012 at 18:58 UTC |