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