1=encoding utf8
2
3=head1 NAME
4
5Mail::Message::Construct::Text - capture a Mail::Message as text
6
7=head1 SYNOPSIS
8
9 my $text = $msg->string;
10 my $text = "$msg";   # via overload
11
12 my @text = $msg->lines;
13 my @text = @$lines;  # via overload
14
15 my $fh   = $msg->file;
16 my $line = <$fh>;
17
18 $msg->printStructure;
19
20=head1 DESCRIPTION
21
22Complex functionality on L<Mail::Message|Mail::Message> objects is implemented in
23different files which are autoloaded.  This file implements the
24functionality related to creating message replies.
25
26=head1 METHODS
27
28=head2 The whole message as text
29
30=over 4
31
32=item $obj-E<gt>B<file>()
33
34Returns the message as file-handle.
35
36=item $obj-E<gt>B<lines>()
37
38Returns the whole message as set of lines.  In LIST context, copies of the
39lines are returned.  In SCALAR context, a reference to an array of lines
40is returned.
41
42=item $obj-E<gt>B<printStructure>( [$fh|undef],[$indent] )
43
44Print the structure of a message to the specified $fh or the
45selected filehandle.  When explicitly C<undef> is specified as handle,
46then the output will be returned as string.
47
48The message's subject and the types of all composing parts are
49displayed.
50
51$indent specifies the initial indentation string: it is added in front
52of each line. The $indent must contain at least one white-space.
53
54example:
55
56 my $msg = ...;
57 $msg->printStructure(\*OUTPUT);
58
59 $msg->printStructure;
60
61 my $struct = $msg->printStructure(undef);
62
63 # Possible output for one message:
64 multipart/mixed: forwarded message from Pietje Puk (1550 bytes)
65    text/plain (164 bytes)
66    message/rfc822 (1043 bytes)
67       multipart/alternative: A multipart alternative (942 bytes)
68          text/plain (148 bytes, deleted)
69          text/html (358 bytes)
70
71=item $obj-E<gt>B<string>()
72
73Returns the whole message as string.
74
75=back
76
77=head2 Flags
78
79=head1 SEE ALSO
80
81This module is part of Mail-Message distribution version 3.011,
82built on July 27, 2021. Website: F<http://perl.overmeer.net/CPAN/>
83
84=head1 LICENSE
85
86Copyrights 2001-2021 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.
87
88This program is free software; you can redistribute it and/or modify it
89under the same terms as Perl itself.
90See F<http://dev.perl.org/licenses/>
91
92