krausr has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that emails me details from a file. The script works fine in a 32-bit version of Activeperl, but does not run using a 64-bit version. It seems to crap out on this line:
$smtp->mail($email_from); # sender's addressuse Net::SMTP; use Win32::EventLog; $summary = ''; $extra = ''; $begin_summary = 0; $data_file = "C:/Logs/myfile.log"; open(IN, $data_file) || die("Could not open file!"); @raw_data = <IN>; close(IN); for my $row (@raw_data) { if ( $row =~ /\s+Total\s+Copied\s+Skipped\s+Mismatch\s+FAILED\s+Ex +tras\s+/ ) { $begin_summary = 1; } if ( $begin_summary ) { $summary .= $row; } if ($row =~ /\s+Ended \: /) { #print "Exiting loop\n"; last; } } write_event(900, EVENTLOG_INFORMATION_TYPE, $summary); send_email("My Big Fat Notification - " . $ENV{COMPUTERNAME}, "$extra\ +n$summary"); sub send_email() { my ($subject, $body) = @_; my $email_from = 'fromster@frobot.com'; my $email_to = ('toster@frobot.com'); my $smtp = Net::SMTP->new('smtpserver.frobot.com'); # Connect to a +n SMTP server $smtp->mail($email_from); # sender's address $smtp->to($email_to); # Recipient's address $smtp->data(); # Start the mail # Send the header. $smtp->datasend("To: $email_to\n"); $smtp->datasend("From: $email_from\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); MORE CODE AFTER THIS...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Mail - 32bit vs 64bit
by marto (Cardinal) on Mar 22, 2017 at 13:35 UTC | |
Re: Mail - 32bit vs 64bit
by LanX (Saint) on Mar 22, 2017 at 14:10 UTC | |
by Anonymous Monk on Mar 22, 2017 at 14:30 UTC | |
Re: Mail - 32bit vs 64bit
by vrk (Chaplain) on Mar 22, 2017 at 17:02 UTC |