1Email::Reply(3) User Contributed Perl Documentation Email::Reply(3)
2
3
4
6 Email::Reply - Reply to a Message
7
9 use Email::Reply;
10
11 my $message = Email::Simple->new(join '', <>);
12 my $from = (Email::Address->parse($message->header('From'))[0];
13
14 my $reply = reply to => $message,
15 from => '"Casey West" <casey@geeknest.com>',
16 all => 1,
17 body => <<__RESPONSE__;
18 Thanks for the message, I'll be glad to explain...
19 __RESPONSE__
20
22 This software takes the hard out of generating replies to email mes‐
23 sages.
24
25 Functions
26
27 reply
28 my $reply = reply to => $message,
29 from => '"Casey West" <casey@geeknest.com>',
30 all => 1;
31 self => 0,
32 attach => 1,
33 quote => 1,
34 top_post => 0,
35 keep_sig => 1,
36 prefix => ': ',
37 attrib => sprintf("From %s, typer of many words:",
38 $from->name),
39 body => <<__RESPONSE__;
40 Thanks for the message, I'll be glad to explain the picture...
41 __RESPONSE__
42
43 This function accepts a number of named parameters and returns an
44 email message object of type "Email::MIME" or "Email::Simple",
45 depending on the parameters passed. Lets review those parameters
46 now.
47
48 "to" - This required parameter is the email message you're replying
49 to. It can represent a number of object types, or a string contain‐
50 ing the message. This value is passed directly to
51 "Email::Abstract" without passing go or collecting $200 so please,
52 read up on its available plugins for what is allowed here.
53
54 "from" - This optional parameter specifies an email address to use
55 indicating the sender of the reply message. It can be a string or
56 an "Email::Address" object. In the absence of this parameter, the
57 first address found in the original message's "To" header is used.
58 This may not always be what you want, so this parameter comes
59 highly recommended.
60
61 "all" - This optional parameter indicates weather or not you'd like
62 to "Reply to All." If true, the reply's "Cc" header will be popu‐
63 lated with all the addresses in the original's "To" and "Cc" head‐
64 ers. By default, the parameter is false, indicating "Reply to
65 Sender."
66
67 "self" - This optional parameter decides weather or not an address
68 matching the "from" address will be included in the list of "all"
69 addresses. If true, your address will be preserved in that list if
70 it is found. If false, as it is by default, your address will be
71 removed from the list. As you might expect, this parameter is only
72 useful if "all" is true.
73
74 "attach" - This optional parameter allows for the original message,
75 in its entirety, to be encapsulated in a MIME part of type "mes‐
76 sage/rfc822". If true, the returned object from "reply" will be a
77 "Email::MIME" object whose second part is the encapsulated message.
78 If false, none of this happens. By default, none of this happens.
79
80 "quote" - This optional parameter, which is true by default, will
81 quote the original message for your reply. If the original message
82 is a MIME message, the first "text/plain" type part will be quoted.
83 If it's a Simple message, the body will be quoted. Well, that's
84 only if you keep the parameter true. If you don't, none of this
85 occurs.
86
87 "top_post" - This optional parameter, whose use is generally dis‐
88 couraged, will allow top posting when true. It will implicitly set
89 "quote" to true, and put your "body" before the quoted text. It is
90 false by default, and you should do your best to keep it that way.
91
92 "keep_sig" - This optional parameter toggles the signature strip‐
93 ping mechanism. True by default, the original quoted body will have
94 its signature removed. When false, the signature is left in-tact
95 and will be quoted accordingly. This is only useful when "quote" is
96 true.
97
98 "prefix" - This optional parameter specifies the quoting prefix. By
99 default, it's ">", but you can change it by setting this parameter.
100 Again, only useful when "quote" is true.
101
102 "attrib" - This optional parameter specifies the attribution line
103 to add to the beginning of quoted text. By default, the name or
104 email address of the original sender is used to replace %s in the
105 string, "%s wrote:". You may change that with this parameter. No
106 special formats, "sprintf()" or otherwise, are provided for your
107 convenience. Sorry, you'll have to make due. Like "prefix" and
108 "keep_sig", this is only good when "quote" is true.
109
110 "body" - This requried parameter contains your prose, your mani‐
111 festo, your reply. Remember to spell check!
112
114 Email::Abstract, Email::MIME, Email::MIME::Creator, Email::Simple::Cre‐
115 ator, Email::Address, perl.
116
118 Casey West, <casey@geeknest.com>.
119
121 Copyright (c) 2004 Casey West. All rights reserved.
122 This module is free software; you can redistribute it and/or modify it
123 under the same terms as Perl itself.
124
125
126
127perl v5.8.8 2007-02-15 Email::Reply(3)