Package com.webobjects.appserver

Examples of com.webobjects.appserver.WOMailDelivery


            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);
            }
        }
View Full Code Here


     * Where the actual logging event is processed and a
     * mail message is generated.
     * @param event logging event
     */
    public void subAppend(LoggingEvent event) {
        WOMailDelivery delivery = WOMailDelivery.sharedInstance();
        String composeTitle = composeTitle(event);
        String content = composeMessage(event);
        String message = delivery.composePlainTextEmail(computedFromAddress(),
                                                        toAddressesAsArray(), ccAddressesAsArray(), composeTitle, content, false);
        if(getExceptionPageName() != null && ERXValueUtilities.booleanValue(formatAsError())) {
            message = "Content-Type: text/html\n" + message;
        }
        if(bccAddresses() != null) {
            message = "BCC: "+bccAddresses()+"\n" + message;
        }
        //LogLog.error(message);
        delivery.sendEmail(message);
    }
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WOMailDelivery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.