Package org.efs.openreports.objects

Examples of org.efs.openreports.objects.MailMessage


        catch(IOException ioe)
        {
            throw new DeliveryException(ioe);
        }  
       
        MailMessage mail = new MailMessage();              
        mail.setSender(user.getEmail());
        mail.parseRecipients(reportSchedule.getRecipients());
        mail.setText(report.getName() + ": Generated on " + new Date());
        mail.setBounceAddress(reportSchedule.getDeliveryReturnAddress());
       
        if (reportSchedule.getScheduleDescription() != null && reportSchedule.getScheduleDescription().trim().length() > 0)
        {
            mail.setSubject(reportSchedule.getScheduleDescription());
        }
        else
        {
            mail.setSubject(reportSchedule.getReport().getName());
        }     
       
        try
        {
            mailProvider.sendMail(mail);   
View Full Code Here


    {
        ArrayList<ByteArrayDataSource> htmlImageDataSources = new ArrayList<ByteArrayDataSource>();
       
        ByteArrayDataSource byteArrayDataSource = exportReport(reportOutput, reportSchedule, htmlImageDataSources);

        MailMessage mail = new MailMessage();              
        mail.setByteArrayDataSource(byteArrayDataSource);
        mail.addHtmlImageDataSources(htmlImageDataSources);         
        mail.setSender(reportSchedule.getUser().getEmail());
        mail.parseRecipients(reportSchedule.getRecipients());
        mail.setBounceAddress(reportSchedule.getDeliveryReturnAddress());
       
        if (reportSchedule.getScheduleDescription() != null && reportSchedule.getScheduleDescription().trim().length() > 0)
        {
            mail.setSubject(reportSchedule.getScheduleDescription());
        }
        else
        {
            mail.setSubject(reportSchedule.getReport().getName());
        }
       
        if (reportSchedule.getExportType() != ExportType.HTML.getCode())
        {
            mail.setText(reportSchedule.getReport().getName() + ": Generated on " + new Date());
        }

        try
        {
            mailProvider.sendMail(mail);
        }
        catch(ProviderException pe)
        {
            throw new DeliveryException(pe);
        }
       
        log.debug(byteArrayDataSource.getName() + " sent to: " + mail.formatRecipients(";"));       
    }
View Full Code Here

TOP

Related Classes of org.efs.openreports.objects.MailMessage

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.