added a "use open :utf-8" to prevent wide char errors in mail sending, wrapped mail...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Sep 2006 16:34:11 +0000 (16:34 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Sep 2006 16:34:11 +0000 (16:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6138 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm

index 31d9535..f2e4b40 100644 (file)
@@ -28,8 +28,11 @@ use OpenILS::Const qw/:const/;
 use OpenILS::Utils::Fieldmapper;
 use Email::Send;
 use Data::Dumper;
+use OpenSRF::EX qw/:try/;
 my $U = 'OpenILS::Application::AppUtils';
 
+use open ':utf8';
+
 
 __PACKAGE__->register_method(
        method => 'send_email_notify_pub',
@@ -166,9 +169,18 @@ sub send_email {
 
        my $sender = Email::Send->new({mailer => 'SMTP'});
        $sender->mailer_args([Host => $smtp]);
-       my $stat = $sender->send($text);
 
-       if( $stat->type eq 'success' ) {
+       my $stat;
+       my $err;
+
+       try {
+               $stat = $sender->send($text);
+       } catch Error with {
+               $err = $stat = shift;
+               $logger->error("Email notify caught error: $err");
+       };
+
+       if( !$err and $stat and $stat->type eq 'success' ) {
                $logger->info("hold_notify: successfully sent hold notification");
                return 1;
        } else {