1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
=head1 NAME
Mail::Message::Construct::Text - capture a Mail::Message as text
=head1 SYNOPSIS
my $text = $msg->string;
my $text = "$msg"; # via overload
my @text = $msg->lines;
my @text = @$lines; # via overload
my $fh = $msg->file;
my $line = <$fh>;
$msg->printStructure;
=head1 DESCRIPTION
Complex functionality on L<Mail::Message|Mail::Message> objects is implemented in
different files which are autoloaded. This file implements the
functionality related to creating message replies.
=head1 METHODS
=head2 The whole message as text
$obj-E<gt>B<file>
=over 4
Returns the message as file-handle.
=back
$obj-E<gt>B<lines>
=over 4
Returns the whole message as set of lines. In LIST context, copies of the
lines are returned. In SCALAR context, a reference to an array of lines
is returned.
=back
$obj-E<gt>B<printStructure>([FILEHANDLE|undef],[INDENT])
=over 4
Print the structure of a message to the specified FILEHANDLE or the
selected filehandle. When explicitly C<undef> is specified as handle,
then the output will be returned as string.
The message's subject and the types of all composing parts are
displayed.
INDENT specifies the initial indentation string: it is added in front
of each line. The INDENT must contain at least one white-space.
I<Example:>
my $msg = ...;
$msg->printStructure(\*OUTPUT);
$msg->printStructure;
my $struct = $msg->printStructure(undef);
# Possible output for one message:
multipart/mixed: forwarded message from Pietje Puk (1550 bytes)
text/plain (164 bytes)
message/rfc822 (1043 bytes)
multipart/alternative: A multipart alternative (942 bytes)
text/plain (148 bytes, deleted)
text/html (358 bytes)
=back
$obj-E<gt>B<string>
=over 4
Returns the whole message as string.
=back
=head2 Flags
=head1 REFERENCES
See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.
=head1 COPYRIGHTS
Distribution version 2.068.
Written by Mark Overmeer (mark@overmeer.net). See the ChangeLog for
other contributors.
Copyright (c) 2001-2006 by the author(s). All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
|