1Mail::Message::ConstrucUts:e:rReCpolnyt(r3i)buted Perl DMoaciulm:e:nMteastsiaogne::Construct::Reply(3)
2
3
4
6 Mail::Message::Construct::Reply - reply to a Mail::Message
7
9 my Mail::Message $reply = $message->reply;
10 my $quoted = $message->replyPrelude($head->get('From'));
11
13 Complex functionality on Mail::Message objects is implemented in
14 different files which are autoloaded. This file implements the
15 functionality related to creating message replies.
16
18 Constructing a message
19 $obj->reply(%options)
20 Start a reply to this message. Some of the header-lines of the
21 original message will be taken. A message-id will be assigned. Some
22 header lines will be updated to facilitate message-thread detection
23 (see Mail::Box::Thread::Manager).
24
25 You may reply to a whole message or a message part. You may wish
26 to overrule some of the default header settings for the reply
27 immediately, or you may do that later with "set" on the header.
28
29 ADDRESSES may be specified as string, or a Mail::Address object, or
30 as array of Mail::Address objects.
31
32 All %options which are not listed below AND start with a capital,
33 will be added as additional headers to the reply message.
34
35 -Option --Default
36 Bcc undef
37 Cc <'cc' in current>
38 From <'to' in current>
39 Message-ID <uniquely generated>
40 Subject replySubject()
41 To <sender in current>
42 body undef
43 group_reply <true>
44 include 'INLINE'
45 max_signature 10
46 message_type Mail::Message
47 postlude undef
48 prelude undef
49 quote '> '
50 signature undef
51 strip_signature qr/^--\s/
52
53 Bcc => ADDRESSES
54 Receivers of blind carbon copies: their names will not be
55 published to other message receivers.
56
57 Cc => ADDRESSES
58 The carbon-copy receivers, by default a copy of the "Cc" field of
59 the source message.
60
61 From => ADDRESSES
62 Your identification, by default taken from the "To" field of the
63 source message.
64
65 Message-ID => STRING
66 Supply a STRING as specific message-id for the reply. By
67 default, one is generated for you. If there are no angles around
68 your id, they will be added.
69
70 Subject => STRING|CODE
71 Force the subject line to the specific STRING, or the result of
72 the subroutine specified by CODE. The subroutine will be called
73 passing the subject of the original message as only argument. By
74 default, Mail::Message::replySubject() is used.
75
76 To => ADDRESSES
77 The destination of your message. By default taken from the
78 "Reply-To" field in the source message. If that field is not
79 present as well, the "From" line is scanned. If they all fail,
80 "undef" is returned by this method: no reply message produced.
81
82 body => BODY
83 Usually, the reply method can create a nice, sufficient message
84 from the source message's body. In case you like more
85 complicated reformatting, you may also create a body yourself
86 first, and pass this on to this "reply" method. Some of the other
87 options to this method will be ignored in this case.
88
89 group_reply => BOOLEAN
90 Will the people listed in the "Cc" headers (those who received
91 the message where you reply to now) also receive this message as
92 carbon copy?
93
94 include => 'NO'|'INLINE'|'ATTACH'
95 Must the message where this is a reply to be included in the
96 message? If "NO" then not. With "INLINE" a reply body is
97 composed. "ATTACH" will create a multi-part body, where the
98 original message is added after the specified body. It is only
99 possible to inline textual messages, therefore binary or
100 multipart messages will always be enclosed as attachment.
101
102 max_signature => INTEGER
103 Passed to "stripSignature" on the body as parameter "max_lines".
104 Only effective for single-part messages.
105
106 message_type => CLASS
107 Create a message with the requested type. By default, it will be
108 a Mail::Message. This is correct, because it will be coerced
109 into the correct folder message type when it is added to that
110 folder.
111
112 postlude => BODY|LINES
113 The line(s) which to be added after the quoted reply lines.
114 Create a body for it first. This should not include the
115 signature, which has its own option. The signature will be added
116 after the postlude when the reply is INLINEd.
117
118 prelude => BODY|LINES
119 The line(s) which will be added before the quoted reply lines.
120 If nothing is specified, the result of the replyPrelude() method
121 is taken. When "undef" is specified, no prelude will be added.
122
123 quote => CODE|STRING
124 Mangle the lines of an "INLINE"d reply with CODE, or by
125 prepending a STRING to each line. The routine specified by CODE
126 is called when the line is in $_.
127
128 By default, '> ' is added before each line. Specify "undef" to
129 disable quoting. This option is processed after the body has
130 been decoded.
131
132 signature => BODY|MESSAGE
133 The signature to be added in case of a multi-part reply. The
134 mime-type of the signature body should indicate this is a used as
135 such. However, in INLINE mode, the body will be taken, a line
136 containing '-- ' added before it, and added behind the epilogue.
137
138 strip_signature => REGEXP|STRING|CODE
139 Remove the signature of the sender. The value of this parameter
140 is passed to Mail::Message::Body::stripSignature(pattern) unless
141 the source text is not included. The signature is stripped from
142 the message before quoting.
143
144 When a multipart body is encountered, and the message is included
145 to ATTACH, the parts which look like signatures will be removed.
146 If only one message remains, it will be the added as single
147 attachment, otherwise a nested multipart will be the result. The
148 value of this option does not matter, as long as it is present.
149 See Mail::Message::Body::Multipart.
150
151 example:
152
153 my $reply = $msg->reply
154 ( prelude => "No spam, please!\n\n"
155 , postlude => "\nGreetings\n"
156 , strip_signature => 1
157 , signature => $my_pgp_key
158 , group_reply => 1
159 , 'X-Extra' => 'additional header'
160 );
161
162 $obj->replyPrelude( [STRING|$field|$address|ARRAY-$of-$things] )
163 Produces a list of lines (usually only one), which will preceded
164 the quoted body of the message. STRING must comply to the RFC822
165 email address specification, and is usually the content of a "To"
166 or "From" header line. If a $field is specified, the field's body
167 must be compliant. Without argument -or when the argument is
168 "undef"- a slightly different line is produced.
169
170 An characteristic example of the output is
171
172 On Thu Oct 13 04:54:34 1995, him@example.com wrote:
173
174 $obj->replySubject(STRING)
175 Mail::Message->replySubject(STRING)
176 Create a subject for a message which is a reply for this one. This
177 routine tries to count the level of reply in subject field, and
178 transform it into a standard form. Please contribute improvements.
179
180 example:
181
182 subject --> Re: subject
183 Re: subject --> Re[2]: subject
184 Re[X]: subject --> Re[X+1]: subject
185 subject (Re) --> Re[2]: subject
186 subject (Forw) --> Re[2]: subject
187 <blank> --> Re: your mail
188
190 Error: Cannot include reply source as $include.
191 Unknown alternative for the "include" option of reply(). Valid
192 choices are "NO", "INLINE", and "ATTACH".
193
195 This module is part of Mail-Message distribution version 3.010, built
196 on October 14, 2020. Website: http://perl.overmeer.net/CPAN/
197
199 Copyrights 2001-2020 by [Mark Overmeer <markov@cpan.org>]. For other
200 contributors see ChangeLog.
201
202 This program is free software; you can redistribute it and/or modify it
203 under the same terms as Perl itself. See http://dev.perl.org/licenses/
204
205
206
207perl v5.32.1 2021-01-27Mail::Message::Construct::Reply(3)