shouldEmail = aBool.booleanValue();
}
if (shouldEmail) {
try {
WOMailDelivery mailer = WOMailDelivery.sharedInstance();
String fromAddress = siteConfig().emailReturnAddr();
NSArray toAddress = null;
String subject = "App stopped running: " + displayName();
String bodyText = message;
if (fromAddress != null) {
fromAddress = "root@" + _host.name();
}
if (_application.notificationEmailAddr() != null) {
toAddress = NSArray.componentsSeparatedByString(_application.notificationEmailAddr(), ",");
}
if (mailer != null && toAddress != null && toAddress.count() > 0) {
mailer.composePlainTextEmail(fromAddress, toAddress, null, subject, bodyText, true);
}
} catch (Throwable localException) {
NSLog.err.appendln("Error attempting to send email: " + localException);
}
}