in reply to Re: How to send email using Email::MIME & Email::Sender::Simple?
in thread How to send email using Email::MIME & Email::Sender::Simple?

Yes I'm using PAR indeed, below is the command I'm using to pack the script into executable. The script is running fine as .pl & .exe in my local system. However when I try to distribute the same exe to a Win Server machine, it fails with the mentioned error.

pp -u -o test.exe test.pl

Also, I did try using Email::Stuffer, but it is again in turn invoking Email::Sender::Simple , which gives me the same error. Perhaps the way I'm packing the script to executable is wrong?

  • Comment on Re^2: How to send email using Email::MIME & Email::Sender::Simple?
  • Download Code

Replies are listed 'Best First'.
Re^3: How to send email using Email::MIME & Email::Sender::Simple?
by haukex (Archbishop) on May 03, 2020 at 16:41 UTC

    Although I'm not an expert on PAR, I still suspect it has something to do with all those use lib dirs. I suggest you inspect all of the directories listed in @INC when the program runs (e.g. print "<<$_>>\n" for @INC;) for which versions of Email::Sender etc. are installed there. Also, I would suggest just removing all of the use lib dirs from the script, as I don't see a good reason why all the C:\Strawberry ones are there in the first place (and "C:\\Strawberry\\perl\\vendor\\lib\\Email" is almost certainly wrong), and just working with Perl's defaults - that's what cpanm will use as well.

      Sure thing, will remove all the explicit directory paths. Will get back if I find something interesting. Thanks a lot!