ActiveState Powered by ActiveState

ActiveState Community


PerlApp and network acces

Posted by RedOne on 2008-01-16 11:28

I have a script that needs to send email out on certain occasions. I've tried using Mail::Sender and Mail::Sendmail both, and in either case, the mail goes out fine when running the .pl file, but when I compile it into an app, most of the code works, but no mail ever goes out.

Anyone have any insight?

Thanks!

MarcZ | Wed, 2008-01-16 11:45

I have built an exe using perlapp that uses Mail::Sender that emails out, including attachments and it works ok.

environment: PDK 7.0.0 build 277058 ActivePerl 5.8.8 Build 822

Confirmed ok on:
Windows XP Pro SP2
Windows 2003 Server SP1

Do you have a personal firewall or antivirus software that might be blocking ? Some have rules by application / executable.

You can set debug to a file on Mail::Sender that might shed light on any errors: example from documentation:

open my $DEBUG, ">> /path/to/debug/file.txt"
                or die "Can't open the debug file: $!\n"
        $sender = new Mail::Sender ({
                ...
                debug => $DEBUG,
        });

debug_level 
Only taken into account if the debug option is specified.

        1 - only log the conversation with the server, skip all message data
        2 - log the conversation and message headers
        3 - log the conversation and the message and part headers
        4 - log everything (default

RedOne | Wed, 2008-01-16 12:28

Thanks for the info, Marc. It turns out to be a typo, which was slipping through in the .pl, but not the .exe.

I'm using Filesys::DfPortable, and had this code:

my $ref = dfportable($ARGV[0]);
if ($ref-{per} > ($ARGV[1] + 0)) {

Note the '-', instead of '->'! Can you say "stupid typo"? No wonder things were working differently!

-->