GT::Mail::Parse - MIME Parse
use GT::Mail::Parse my $parser = new GT::Mail::Parse ( naming => \&name_files, in_file => '/path/to/file.eml', debug => 1 );
my $top = $parser->parse or die $GT::Mail::Parse::error;
- or -
my $parser = new GT::Mail::Parse; open FH, '/path/to/file.eml' or die $!; my $top = $parser->parse ( naming => \&name_files, handle => \*FH, debug => 1 ) or die $GT::Mail::Parse::error; close FH;
- or -
my $parser = new GT::Mail::Parse;
my $top_head = $parser->parse_head ( naming => \&name_files, in_file => '/path/to/file.eml', debug => 1 ) or die $GT::Mail::Parse::error;
GT::Mail::Parse is a 100% rfc822 email MIME parser that supports unlimited nested levels of MIME. Emails are parsed into the GT::Mail::Parts manpage objects. Each part knows where it's body is and each part contains it's sub parts. See the GT::Mail::Parts manpage for details on parts methods.
This is the constructor method to get a GT::Mail::Parse object, which you
need to access all the methods (there are no Class methods). new()
takes
a hash or hash ref as it's arguments. Each key has an accessor method by the
same name except debug, which can only be set by passing debug to new(), parse()
or parse_head().
Instance method. Parses the email specified by either in_file or handle. Returns the top level the GT::Mail::Parts manpage object. Any additional parameters passed in are treated the same as if they were passed to the constuctor.
Instance method. This method is exactly the same as parse except only the top level header is parsed and it's part object returned. This is useful to keep overhead down if you only need to know about the header of the email.
Instance method. Returns the total size in bytes of the parsed unencoded email. This method will return undef if no email has been parsed.
Instance method. Returns all the parts in the parsed email. This is a flatened list of the objects. Somewhat similar to what MIME::Tools does. All the parts still contain their sub parts.
Copyright (c) 2004 Gossamer Threads Inc. All Rights Reserved. http://www.gossamer-threads.com/
Revision: $Id: Parse.pm,v 1.79 2004/10/23 02:16:39 brewt Exp $