Initial import
[Net-Plesk.git] / lib / Net / Plesk / Method / mail_add.pm
1 package Net::Plesk::Method::mail_add;
2
3 use strict;
4
5 use vars qw( $VERSION @ISA $AUTOLOAD $DEBUG );
6
7 @ISA = qw( Net::Plesk::Method );
8 $VERSION = '0.01';
9
10 $DEBUG = 0;
11
12 =head1 NAME
13
14 Net::Plesk::Method::mail_add - Perl extension for Plesk XML Remote API mail addition
15
16 =head1 SYNOPSIS
17
18   use Net::Plesk::Method::mail_add
19
20   my $p = new Net::Plesk::Method::mail_add ( $domainID, $mailbox, $passwd );
21
22   $request = $p->endcode;
23
24 =head1 DESCRIPTION
25
26 This module implements an interface to construct a request for a mailbox
27 addition using SWSOFT's Plesk.
28
29 =head1 METHODS
30
31 =over 4
32
33 =item init args ...
34
35 Initializes a Plesk mail_add object.  The I<domainID>, I<mailbox>,
36 and I<passwd> options are required.
37
38 =cut
39
40 sub init {
41   my ($self, $domainid, $mailbox, $password) = @_;
42   $$self = join ( "\n", (
43                     '<mail>',
44                     '<create>',
45                     '<filter>',
46                     '<domain_id>',
47                     $self->encode($domainid),
48                     '</domain_id>',
49                     '<mailname>',
50                     '<name>',
51                     $self->encode($mailbox),
52                     '</name>',
53                     '<password>',
54                     $self->encode($password),
55                     '</password>',
56                     '</mailname>',
57                     '</filter>',
58                     '</create>',
59                     '</mail>',
60                   ));
61 }
62
63 =back
64
65 =head1 BUGS
66
67   Creepy crawlies.
68
69 =head1 SEE ALSO
70
71 SWSOFT Plesk Remote API documentation (1.4.0.0 or later)
72
73 =head1 AUTHOR
74
75 Jeff Finucane E<lt>jeff@cmh.netE<gt>
76
77 =head1 COPYRIGHT AND LICENSE
78
79 Copyright (C) 2006 Jeff Finucane
80
81 This library is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.
83
84 =cut
85
86 1;
87