--- loncom/interface/lonmsg.pm 2003/10/15 18:01:10 1.67 +++ loncom/interface/lonmsg.pm 2003/10/15 20:34:37 1.68 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.67 2003/10/15 18:01:10 www Exp $ +# $Id: lonmsg.pm,v 1.68 2003/10/15 20:34:37 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -218,9 +218,10 @@ sub sendemail { my $msg = new Mail::Send; $msg->to($to); $msg->subject('[LON-CAPA] '.$subject); - my $fh = $msg->open('smtp',Server => 'localhost'); - print $fh $body; - $fh->close; + if (my $fh = $msg->open('smtp',Server => 'localhost')) { + print $fh $body; + $fh->close; + } } # ==================================================== Send notification emails