@@ -, +, @@ SendAlerts --- C4/Letters.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/C4/Letters.pm +++ a/C4/Letters.pm @@ -357,13 +357,15 @@ sub SendAlerts { $mail->text_body( $letter->{content} ); } + my $error; try { $mail->send_or_die({ transport => $library->smtp_server->transport }); } catch { carp "$_"; - return { error => "$_" }; + $error = $_; }; + return { error => $error } if $error; } } elsif ( $type eq 'claimacquisition' or $type eq 'claimissues' or $type eq 'orderacquisition' ) { @@ -511,13 +513,15 @@ sub SendAlerts { $mail->text_body( "" . $letter->{content} ); } + my $error; try { $mail->send_or_die({ transport => $library->smtp_server->transport }); } catch { carp "$_"; - return { error => "$_" }; + $error = $_; }; + return { error => $error } if $error; logaction( "ACQUISITION", --