sub _create_attachment_part {
my ($self, $attachment) = @_;
sub _create_attachment_part {
my ($self, $attachment) = @_;
} else {
# strip path
$attributes{filename} = $attachment;
$attributes{filename} =~ s:.*\Q$self->{fileid}\E:: if $self->{fileid};
$attributes{filename} =~ s:.*/::g;
} else {
# strip path
$attributes{filename} = $attachment;
$attributes{filename} =~ s:.*\Q$self->{fileid}\E:: if $self->{fileid};
$attributes{filename} =~ s:.*/::g;
return undef if !defined $attachment_content;
my $application = ($attachment =~ /(^\w+$)|\.(html|text|txt|sql)$/) ? 'text' : 'application';
return undef if !defined $attachment_content;
my $application = ($attachment =~ /(^\w+$)|\.(html|text|txt|sql)$/) ? 'text' : 'application';
$status //= $self->{driver}->status if $self->{driver};
$status //= 'failed';
$extended_status //= $self->{driver}->extended_status if $self->{driver};
$extended_status //= 'unknown error';
$status //= $self->{driver}->status if $self->{driver};
$status //= 'failed';
$extended_status //= $self->{driver}->extended_status if $self->{driver};
$extended_status //= 'unknown error';
my $headers = join "\r\n", (bundle_by { join(': ', @_) } 2, @{ $self->{headers} || [] });
my $headers = join "\r\n", (bundle_by { join(': ', @_) } 2, @{ $self->{headers} || [] });