line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 1995-2018 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
|
|
989
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
138
|
|
11
|
|
|
|
|
|
|
$VERSION = '2.20'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
429
|
use Mail::Mailer (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
789
|
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
0
|
0
|
sub Version { our $VERSION } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#------------------ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new(@) |
23
|
2
|
|
|
2
|
1
|
36
|
{ my ($class, %attr) = @_; |
24
|
2
|
|
|
|
|
5
|
my $self = bless {}, $class; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
11
|
while(my($key, $value) = each %attr) |
27
|
2
|
|
|
|
|
7
|
{ $key = lc $key; |
28
|
2
|
|
|
|
|
7
|
$self->$key($value); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
9
|
$self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#--------------- |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set($@) |
37
|
10
|
|
|
10
|
1
|
37
|
{ my ($self, $hdr, @values) = @_; |
38
|
10
|
50
|
|
|
|
31
|
$self->{$hdr} = [ @values ] if @values; |
39
|
10
|
50
|
|
|
|
14
|
@{$self->{$hdr} || []}; # return new (or original) values |
|
10
|
|
|
|
|
35
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub add($@) |
44
|
1
|
|
|
1
|
1
|
9
|
{ my ($self, $hdr, @values) = @_; |
45
|
1
|
|
|
|
|
31
|
push @{$self->{$hdr}}, @values; |
|
1
|
|
|
|
|
10
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub delete($) |
50
|
1
|
|
|
1
|
1
|
9
|
{ my($self, $hdr) = @_; |
51
|
1
|
|
|
|
|
4
|
delete $self->{$hdr}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
1
|
6
|
sub to { my $self=shift; $self->set('To', @_); } |
|
2
|
|
|
|
|
5
|
|
56
|
1
|
|
|
1
|
1
|
7
|
sub cc { my $self=shift; $self->set('Cc', @_); } |
|
1
|
|
|
|
|
4
|
|
57
|
2
|
|
|
2
|
1
|
14
|
sub bcc { my $self=shift; $self->set('Bcc', @_); } |
|
2
|
|
|
|
|
4
|
|
58
|
2
|
|
|
2
|
1
|
9
|
sub subject { my $self=shift; $self->set('Subject', join (' ', @_)); } |
|
2
|
|
|
|
|
7
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#--------------- |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub open(@) |
63
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
64
|
0
|
|
|
|
|
|
Mail::Mailer->new(@_)->open($self); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |