Click to See Complete Forum and Search --> : MIME::Parser


buggy
03-31-2005, 11:11 AM
I am using this module to get the body of a mail. When I execute the script below, 2 file are generated one html and one txt file. However both files are randomly named (it seems). I wish to specify the name of the .txt file and html files, (call them NewMsg.txt and NewMsg.html) respectively.

Code below :

$Msg_Path = 'V:/Test/md50000004264.msg';

open(FH, $Msg_Path) or die "Cannot open file $!";
my $FileString = do { local $/; <FH> };
close(FH);

my $parser = new MIME::Parser;
$entity = $parser->parse_data($FileString);

Jeff Mott
03-31-2005, 06:49 PM
Is there more to that script? I don't see anything that would write any files.

You could also check the documentation for MIME::Parser (http://search.cpan.org/~dskoll/MIME-tools-5.417/lib/MIME/Parser.pm) for more info.

buggy
04-01-2005, 02:49 AM
Nope that what I dont understand. I dont see how the file are created and how I can name them.

buggy
04-01-2005, 05:54 AM
OK I can now control the output and the files are written out. However when I use this module I get the error below. Any ideas?

Can't locate auto/Mail/Internet/autosplit.ix in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib .) at C:/Perl/lib/AutoLoader.pm line 146.

Charles
04-01-2005, 06:42 AM
The module's package hasn't been properly installed.

buggy
04-01-2005, 11:16 AM
Why is it complaining about auto/Mail/Internet/autosplit.ix when I am only using the following packages. I am on windows, where can I get the missing file from. I had a lot of problem with Mail::Internet and I dont use it at all.

use Email::Simple;
use MIME::Parser;
use DBI();

Its not in the ppm.

Jeff Mott
04-01-2005, 11:26 AM
If it's not in the PPM then installing modules can be tricky. In particular the few that require compiling for your particular system.

You will have to use the CPAN (http://search.cpan.org/~andk/CPAN-1.76/lib/CPAN.pm) module and you will need to have Microsoft Visual C++ installed on your system (this is because VC++ is what ActiveState used to compile their distribution).