NAME
Email::AutoReply - Perl extension for writing email autoresponders
SYNOPSIS
use Email::AutoReply;
my $auto = Email::AutoReply->new;
$auto->reply;
DESCRIPTION
This module may be useful in writing autoresponders. The example code above will try to respond (using Sendmail) to an email message given as standard input.
The module will reply once to each email address it sees, storing sent-to addresses in a database. This database is Email::AutoReply::DB::BerkeleyDB by default, but any class that implements Email::AutoReply::DB may be used.
ATTRIBUTES
All attributes are set and get using code similar to the following:
$auto = new Email::AutoReply;
# get debug status
$dbg = $auto->debug;
# set debug status to "on"
$auto->debug(1);
- cachedb_type
-
Set/get the class to use for the cache DB.
Default: 'Email::AutoReply::DB::BerkeleyDB'
- debug
-
Set/get weather debugging is enabled. 0 means off, 1 means on.
Default: 0
- hostname
-
Set/get the hostname where this package will be executed. This is used when constructing a 'from' address for the autoreply and for adding an X-Mail-AutoReply header to the autoreply.
Default: (the addressed-to domain in input_email)
- input_email
-
Set/get the email to parse and reply to.
- response_text
-
Set/get the string which will serve as the body of the autoreply.
- settings_dir
-
Set/get the directory to in which to store Email::AutoReply settings.
Default: /home/$ENV{HOME}/.email-autoreply
- send_method
-
Set/get the Email::Send class used to send the autoreply.
Default: 'Sendmail'
- subject
-
Set/get the subject to be used in the autoreply.
Default: 'Out Of Office Automated Response'
- user
-
Set/get the user who is executing this code. This is used when constructing a 'from' address for the autoreply and for adding an X-Mail-AutoReply header to the autoreply.
Default: (the addressed-to user in input_email)
METHODS
- new
-
Takes any attributes as arguments, or none:
# set the debug and response_text attributes my $auto = Email::AutoReply->new( debug => 1, response_text => "I'm on vacation, ttyl." ); # no arguments my $auto = Email::AutoReply->new;
Returns a new Email::AutoReply object.
- dbdump
-
Takes no arguments.
Returns a list of emails in the "already sent to" database.
- reply
-
Takes no arguments. If the 'input_email' attribute is set, this class will read that as the email to (possibly) autoreply to. If the 'input_email' attribute is not set, an email message will be extracted from standard input.
No return value.
AUTHOR
Adam Monsen, <adamm@wazamatta.com>
BUGS
To report bugs, go to
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Email-AutoReply
or send mail to <bug-Email-AutoReply@rt.cpan.org>
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Adam Monsen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.