line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 1995-2017 by [Mark Overmeer ]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
package Mail::Send; |
6
|
2
|
|
|
2
|
|
500
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
120
|
|
7
|
|
|
|
|
|
|
$VERSION = '2.19'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
249
|
use Mail::Mailer (); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
636
|
|
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
0
|
0
|
sub Version { our $VERSION } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#------------------ |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new(@) |
19
|
2
|
|
|
2
|
1
|
33
|
{ my ($class, %attr) = @_; |
20
|
2
|
|
|
|
|
4
|
my $self = bless {}, $class; |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
9
|
while(my($key, $value) = each %attr) |
23
|
2
|
|
|
|
|
5
|
{ $key = lc $key; |
24
|
2
|
|
|
|
|
7
|
$self->$key($value); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
9
|
$self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#--------------- |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub set($@) |
33
|
10
|
|
|
10
|
1
|
29
|
{ my ($self, $hdr, @values) = @_; |
34
|
10
|
50
|
|
|
|
25
|
$self->{$hdr} = [ @values ] if @values; |
35
|
10
|
50
|
|
|
|
11
|
@{$self->{$hdr} || []}; # return new (or original) values |
|
10
|
|
|
|
|
31
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub add($@) |
40
|
1
|
|
|
1
|
1
|
7
|
{ my ($self, $hdr, @values) = @_; |
41
|
1
|
|
|
|
|
2
|
push @{$self->{$hdr}}, @values; |
|
1
|
|
|
|
|
4
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub delete($) |
46
|
1
|
|
|
1
|
1
|
8
|
{ my($self, $hdr) = @_; |
47
|
1
|
|
|
|
|
3
|
delete $self->{$hdr}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
2
|
|
|
2
|
1
|
20
|
sub to { my $self=shift; $self->set('To', @_); } |
|
2
|
|
|
|
|
5
|
|
52
|
1
|
|
|
1
|
1
|
8
|
sub cc { my $self=shift; $self->set('Cc', @_); } |
|
1
|
|
|
|
|
4
|
|
53
|
2
|
|
|
2
|
1
|
12
|
sub bcc { my $self=shift; $self->set('Bcc', @_); } |
|
2
|
|
|
|
|
5
|
|
54
|
2
|
|
|
2
|
1
|
10
|
sub subject { my $self=shift; $self->set('Subject', join (' ', @_)); } |
|
2
|
|
|
|
|
8
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#--------------- |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub open(@) |
59
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
60
|
0
|
|
|
|
|
|
Mail::Mailer->new(@_)->open($self); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |