lib/Email/Blaster/MailSender.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 32 CC 3 SCAR 13.9
CC
3
Cov
0%
new
6.0
send_message
6.0
BEGIN
2.0
CRAP 4.0
1  
2 package Email::Blaster::MailSender;
3  
4 use strict;
5 use warnings 'all';
6 use MIME::Base64;
7 use Mail::Sendmail;
8  
9  
10 #==============================================================================
11 sub new
12 {
13 my ($class, %args) = @_;
14
15 $class = ref($class) ? ref($class) : $class;
16
17 return bless \%args, $class;
18 }# end new()
19  
20  
21 #==============================================================================
22 sub send_message
23 {
24 my ($s, %args) = @_;
25
26 my $to = $args{blaster}->config->is_testing ?
27 $args{blaster}->config->test_email_address : $args{sendlog}->email;
28
29 sendmail(
30 To => $to,
31 From => '"' . $args{transmission}->from_name . '" <' . $args{transmission}->from_address . '>',
32 'reply-to' => $args{transmission}->reply_to,
33 Subject => $args{subject},
34 Message => encode_base64( $args{content} ),
35 'content-type' => $args{transmission}->content_type,
36 'content-transfer-encoding' => 'base64',
37 );
38
39 my ($queued_as) = $Mail::Sendmail::log =~ m/\s+queued as\s+(.*)/;
40 return $queued_as;
41 }# end send_message()
42  
43 1;# return true:
44