line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 1995-2019 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
|
|
|
|
|
|
|
# This code is part of the bundle MailTools. Meta-POD processed with |
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md for Copyright. |
7
|
|
|
|
|
|
|
# Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Mail::Send; |
10
|
2
|
|
|
2
|
|
825
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
125
|
|
11
|
|
|
|
|
|
|
$VERSION = '2.21'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
40
|
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
406
|
use Mail::Mailer (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
841
|
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
0
|
0
|
sub Version { our $VERSION } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#------------------ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new(@) |
23
|
2
|
|
|
2
|
1
|
37
|
{ my ($class, %attr) = @_; |
24
|
2
|
|
|
|
|
7
|
my $self = bless {}, $class; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
11
|
while(my($key, $value) = each %attr) |
27
|
2
|
|
|
|
|
7
|
{ $key = lc $key; |
28
|
2
|
|
|
|
|
6
|
$self->$key($value); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
19
|
$self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#--------------- |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set($@) |
37
|
10
|
|
|
10
|
1
|
40
|
{ my ($self, $hdr, @values) = @_; |
38
|
10
|
50
|
|
|
|
37
|
$self->{$hdr} = [ @values ] if @values; |
39
|
10
|
50
|
|
|
|
13
|
@{$self->{$hdr} || []}; # return new (or original) values |
|
10
|
|
|
|
|
56
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub add($@) |
44
|
1
|
|
|
1
|
1
|
8
|
{ my ($self, $hdr, @values) = @_; |
45
|
1
|
|
|
|
|
2
|
push @{$self->{$hdr}}, @values; |
|
1
|
|
|
|
|
4
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub delete($) |
50
|
1
|
|
|
1
|
1
|
13
|
{ my($self, $hdr) = @_; |
51
|
1
|
|
|
|
|
3
|
delete $self->{$hdr}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
1
|
8
|
sub to { my $self=shift; $self->set('To', @_); } |
|
2
|
|
|
|
|
4
|
|
56
|
1
|
|
|
1
|
1
|
9
|
sub cc { my $self=shift; $self->set('Cc', @_); } |
|
1
|
|
|
|
|
3
|
|
57
|
2
|
|
|
2
|
1
|
17
|
sub bcc { my $self=shift; $self->set('Bcc', @_); } |
|
2
|
|
|
|
|
4
|
|
58
|
2
|
|
|
2
|
1
|
10
|
sub subject { my $self=shift; $self->set('Subject', join (' ', @_)); } |
|
2
|
|
|
|
|
9
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#--------------- |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub open(@) |
63
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
64
|
0
|
|
|
|
|
|
Mail::Mailer->new(@_)->open($self); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |