Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

MIME::Lite ssleay error

by sweetblood (Prior)
on May 26, 2016 at 18:33 UTC ( [id://1164212]=perlquestion: print w/replies, xml ) Need Help??

sweetblood has asked for the wisdom of the Perl Monks concerning the following question:

I'm having a strange problem using MIME::Lite, quite some time ago I wrote or mostly stole a sendmail function. I've been using this in many different perl scripts for at least 15 years probably longer, never had a problem. Recently we built up a windows 2008R2 64bit server for passing data around SQL and the like.

This script here illustrates the issue, using komodo and strawberry perl. When I simply run the script it does all that I ask it to ie: I get my email, but I also get the error listed at the bottom. If however I break on the first eval in the function then run from there I get no error. Again, the script does run to completion either way.

Any ideas?
#!/usr/bin/perl -w use strict; use MIME::Lite; use File::Basename; sendmail('someuser@foobar.com', "Foo", "bar\n"); sub sendmail { my ($recipients, $subject, $msg) = @_; my ($me) = basename($0) =~ /^([^\.]*?)\./; my $mailhost = 'mail.foobar.com'; my $fromAddress = $me . '@foobar.com'; $msg =~ s/[\r\n]//g; my $type = ($msg =~ /\n/) ? 'text/plain' : 'text/html'; eval { $msg=MIME::Lite->new( To => "$recipients", From => "$fromAddress", Subject => "$subject", Type => $type, #'text/html', Data => "$msg" ) or warn "new $!"; }; do { warn 'MIME::Lite->new() - ' . $@; return 0; } if $@; eval { MIME::Lite->send('smtp', "$mailhost") or warn $!; $msg->send() or warn "sending $!"; }; do { warn 'MIME:Lite->send() - ' . $@; return 0; } if $@; 1; }

Error
Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm (autosplit into blib\lib\auto\Net\SSLeay\randomize.al) line 924.

Sweetblood

Replies are listed 'Best First'.
Re: MIME::Lite ssleay error
by Mr. Muskrat (Canon) on May 26, 2016 at 18:56 UTC
      I reinstalled all of them, but no luck.

      Sweetblood

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1164212]
Approved by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-25 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found