- my $error = '';
- if ( ref($transport) ) {
-
- warn "$me sending message\n" if $DEBUG;
- my $message = join("\n", $cust_msg->header, $cust_msg->body);
-
- local $SIG{__DIE__}; # don't want Mason __DIE__ handler active
- local $@;
- eval { sendmail( $message, { transport => $transport,
- from => $cust_msg->env_from,
- to => \@env_to })
- };
- if (ref($@) and $@->isa('Email::Sender::Failure')) {
- $error = $@->code.' ' if $@->code;
- $error .= $@->message;
- } else {
- $error = $@;
- }
- } else {
- $error = $transport;
- }