Sending multiple reports thru single mail in Crystal reports server XI R2

2)
Ex:
I have a crystal report  which takes country as input parameter. Each country has one responsible person.
US--- A person
UK---B person
INDIA ---C person
I need to run this report with these three paramters(may increase infuture) and send the exported report to A,B and C as an mail attachment through crystal reports server XI R2.
I have achieved above with Java code and deployed that java code as JAR file in crystal reports server and scheduled this JAR file.
Here I need to attach all these three attachments to single mail and send it to Manager. And also I need to wait till all the reports gets executed and then attach all the attachments to single mail.
Please help me how to achieve this.
I am using --- Crystal reports server XI R2
Thanks,
Vijay Kanth

How are you creating the first three files, are you scheduling each to smtp, or are you waiting until they finish and emailing the instance through your jar file?
If you are scheduling each one, and the instance in enterprise keeps a copy of the finished report, then you could monitor the status of the 3 jobs, once all finish you could get the report and email them out through your java code.  There wouldn't be a way to email all three reports as one email to the manager directly through the product.  You would be able to cc or bcc the manager on each, but then the manager would be receiving 3 emails.

Similar Messages

  • How to send multiple attachements in single mail

    Hi All,
    Currently i am using this function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with only one attachment.
    But now i need to send multiple attachments to a single mail.
    Can any one please tell me as how to send multiple attachments in single mail.
    Thanks in advance.

    Hi
    See this and do accordingly
    Mailing with Attachment by ABAP Coding  
    Refer this link:
    Mail with attachment.
    FORM send_list_to_basis .
      DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
            lt_index    TYPE sy-tabix,
            doc_type(3) TYPE c,
            descr       LIKE it_objpack_basis-obj_descr,
            temp_data   LIKE w_path,
            temp1       TYPE string,
            tab_lines   TYPE i,
            langu(15)   TYPE c,
            expirydate  TYPE so_obj_edt,
            L_FILE1(100).
      CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
      W_PATH-FILENAME = L_FILE1.
      APPEND w_path.
      CLEAR w_path.
      wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
      wa_doc_chng-obj_langu  = 'E'.
      wa_doc_chng-obj_expdat = sy-datum.
      CLEAR w_subject.
      CONCATENATE 'Please find attached document with list of users'
                  'not logged on for 180 days for client' sy-mandt
                  INTO w_subject SEPARATED BY space.
      it_objtxt_basis-line = w_subject.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      it_objtxt_basis-line = text-004.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      CLEAR w_tab_line.
      DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
      READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
      wa_doc_chng-doc_size =
       ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
      CLEAR it_objpack_basis-transf_bin.
      it_objpack_basis-head_start = 1.
      it_objpack_basis-head_num   = 0.
      it_objpack_basis-body_start = 1.
      it_objpack_basis-body_num   = w_tab_line.
      it_objpack_basis-doc_type   = 'RAW'.
      APPEND it_objpack_basis.
      CLEAR it_objpack_basis.
      LOOP AT w_path.
        temp1 = w_path.
        descr = w_path.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '\'
            string    = descr
          IMPORTING
            head      = descr
            tail      = temp_data.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '.'
            string    = descr
          IMPORTING
            head      = temp_data
            tail      = doc_type.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename      = temp1
            filetype      = 'BIN'
            header_length = 0
            read_by_line  = 'X'
            replacement   = '#'
          TABLES
            data_tab      = it_upload.
        DESCRIBE TABLE it_upload LINES tab_lines.
        DESCRIBE TABLE it_objbin_basis LINES lt_index.
        lt_index = lt_index + 1.
        LOOP AT it_upload.
          wa_objbin_basis-line = it_upload-line.
          APPEND wa_objbin_basis TO it_objbin_basis.
          CLEAR wa_objbin_basis.
        ENDLOOP.
        it_objpack_basis-transf_bin = 'X'.
        it_objpack_basis-head_start = 0.
        it_objpack_basis-head_num   = 0.
        it_objpack_basis-body_start = lt_index.
        it_objpack_basis-body_num   = tab_lines.
        it_objpack_basis-doc_type   = doc_type.
        it_objpack_basis-obj_descr  = descr.
        it_objpack_basis-doc_size   = tab_lines * 255.
        APPEND it_objpack_basis.
        CLEAR it_objpack_basis.
      ENDLOOP.
      it_reclist_basis-receiver = '[email protected]'.
      it_reclist_basis-rec_type = 'U'.
      APPEND it_reclist_basis.
      CLEAR it_reclist_basis.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = it_objpack_basis
          contents_txt               = it_objtxt_basis
          contents_bin               = it_objbin_basis
          receivers                  = it_reclist_basis
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
      ENDIF.
    ENDFORM.                    " send_list_to_basis
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to send multiple attachment in single mail

    i am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending mail.
    pls guide me how can i modify my code so that i can send multiple attachments

    Hi Manish,
    Check out the links below.
    E-mail multiple PDF attachments
    Send a Single Mail with Multiple Attachment
    Hope it helps.
    Regards,
    Amit
    *Always reward points for helpful answers
    Message was edited by:
            Amit Kumar

  • How to attach Multiple attachments to single mail

    How to attach multiple pdfs to single mail  ?
    or
    how to attach one pdf & One excel & One word document to single mail ?
    Thanks In Advance

    Hello Karunya,
    Please refer to the link below.
    https://wiki.sdn.sap.com/wiki/display/Snippets/Send%20email%20with%20multiple%20zipped%20attachments
    Regards,
    P Bansal

  • Send Separate Remittance Advice - Can I send multiple files to single supplier based on custom groups

    I want to send multiple emails to single supplier based on the Legal Entity of the invoice paid.
    eg. If a supplier has two invoices in a payment, both are paid by different legal entities of invoices payable .. then I want to send to different emails to the same supplier
    I am able to create 2 pages in the RTF using <?for-each-group:OutboundPayment;DocumentPayable/DocumentPayerLegalEntityName?>
    But I am unable to send 2 emails
    please help..

    When I know i'll be transforming or adding additional filters, I prefer to go directly to creating smart objects rather than grouping them first, since the relevant layers are automatically "grouped" by being pulled into the smart object. My thought is that the default name for a smart object (or a group, for that matter) should be the lowest layer on the selected stack that has a non-default name, since in most cases that's the one you'd want to use for the new smart object. I don't know exactly how Photoshop recognizes layer names, but since it knows what number to assign to new layers or individual types of adjustment layers, it should also be able to recognize when a layer name is not a default name.

  • How to Concat multiple columns to single column at the report level

    Hi All,
    I have a requirement in such a way that I have to concat multiple colulmns to single column at the report level.
    First of all the column I am using in my report is "X" with datatype as Integer. Now  if the length of this column "X" is <8 then I have add zero's (0) before the number.
    And then I have to concat with a column "Y" and then cocnat with a column "Z" and finally the datatype should be casted to CHAR.
    Can anyone please let me know the logic how I can add to my column so that it satisfies all the above.
    Thanks All

    >Also, Another thing is if X < length of 8 Ihave to append with zero's..
    >Ex: if the actual value of X is 123456 i wanted to show it as 000123456.
    Try to be consistence what you said, you are looking for 8 length and above ex is 9 in length.
    You need to learn many things one of those is CASE, at least do copy and also read
    Forums Etiquette/Reward Points

  • Crystal Reports for Eclipse vs. Crystal Reports Developer

    We are developing a Java web application for internal use.  Since we have some people at the company who are familiar with Crystal Reports, we'd like to have them write reports that we can display through our application.  Crystal Reports Server seems like overkill for this project, but the <a href="http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm#en/JRC_SDK/">JRC</a> sounded like a good fit.
    I have been evaluating <a href="http://www.businessobjects.com/products/reporting/crystalreports/developer/default.asp">Crystal Reports Developer</a> and trying out the <a href="http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_web_samples.zip.asp">JRC samples</a>.  The samples don't use the tag library.  Instead, they show how to set session variables and redirect to a viewer JSP which contains a bunch of Java code to use the CrystalReportViewer.
    The samples are so much more complex than the code created by Crystal Reports for Eclipse, which simply uses the tag library:
    <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>
    <crviewer:viewer reportSourceType="reportingComponent" viewerName="myreport-viewer" reportSourceVar="myreport" isOwnPage="true">
    <crviewer:report reportName="myreport.rpt" />
    </crviewer:viewer>
    I assume that I should be able to use the same tag library approach without using Crystal Reports for Eclipse, but I haven't seen any tutorials on it.  I'm trying to understand whether I should purchase Crystal Reports for Eclipse instead of Crystal Reports Developer.
    This is the difference, as I understand it:
    Crystal Reports Developer gives you the stand-alone Crystal Reports Designer and the right to run the JRC on an internal server.  It costs <a href="http://store.businessobjects.com/store/bobjects/DisplayProductDetailsPage/productID.40434600">$595</a>.
    Crystal Reports for Eclipse Standard provides a free report designer built into Eclipse.  It also includes the JRC for use on an internal server.
    Crystal Reports for Eclipse Professional provides "a more powerful runtime engine" with the right to run it on one internal server.  It costs <a href="http://store.businessobjects.com/store/bobjects/DisplayProductDetailsPage/productID.52068100">$495</a>.  Is this the same JRC provided with Crystal Reports Developer?
    If the "powerful" JRC is the same as Crystal Reports Developer's JRC, could I install Crystal Reports for Eclipse Standard to take advantage of the Eclipse integration and the built-in designer, but use the more powerful JRC from Crystal Reports Developer, which would also give me the stand-alone designer?

    <p>Hi there,</p><p>     If you are planning on deploying a JRC application then you should definitely be using Crystal Reports for Eclipse for your runtime engine. It is the latest version of the JRC and includes many updates not available in Crystal Reports Developer.</p><p>As for "power" the JRC included in CR Developer is on par with the JRC available in the Basic edition of Crystal Reports for Eclipse. The Professional edition of Crystal Reports for Eclipse provides the most powerful version of the JRC available.</p><p>With the release of Crystal Reports for Eclipse, Business Objects is setting the groundwork for separating Developer needs from the Report Author needs.</p><p>A professional report author will require a professional report design tool. For these users we are recommending that they purchase Crystal Reports Professional.</p><p>The developer, on the other hand, generally needs the SDKs and a toolkit to assist with building applications. We believe that these should be available at no cost to the developer, only charging when the application is deployed (in this case a CR4E Pro license). This is different from the current model with Crystal Reports Developer where we have combined a professional report designer plus the required runtime.</p><p>So, to summarize, definitely use Crystal Reports for Eclipse for your application runtime and have your report authors puchase Crystal Reports Professional. If you need a more powerful engine, access to technical support or plan to deploy on multiple servers then I would recommend purchasing the Crystal Reports for Eclipse Professional license for your development purposes.</p><p>As for some tutorials on creating viewer pages, the integration in Eclipse provides a very simple way of accomplishing this. I would suggest reading the section titled "<strong>Creating a New Viewer Page</strong>" in our Getting Started Guide found at the following URL:</p><p><a href="/node/320"><strong> http://diamond.businessobjects.com/node/320</strong></a></p><p>Let me know if you have some follow-up questions. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><strong><br /><a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a></strong>           </p>

  • Report Selection Formula Error with Crystal Reports 2008 SP3 Fix Pack 3.5

    Hello,
    My name is Carlos, and I would like to report a defect found in the Crystal Reports 2008 SP 3 Fix Pack 3.5 Runtime that is affecting the majority of our reports.  As well, I would like to ask if there is a simple workaround that does not involve updating hundreds of reports.
    The issue is that the runtime engine incorrectly returns the report selection formula.  I have included sample code showing what I mean.
    To reproduce;
    1. Create a simple report that has a date range filter like: 
      ({Orders.Order_Date} >= {?START_DATE})  
      AND ({Orders.Order_Date} <= {?END_DATE})
    2. Create a test app as follow that loads a report using the following code:
    ReportDocument rpt = null;
    try
      rpt = new ReportDocument();
      rpt.Load("TestReport.rpt");
      this.txtMessage.Text = string.Format(
        "ReportSelectionFormula:{0}{1}",
         Environment.NewLine,
      rpt.RecordSelectionFormula);
    catch (Exception ex)     
      this.txtMessage.Text = ex.ToString();     
    3.  Install Crystal Reports 2008 SP3 Fix Pack 3.5 Runtime [https://smpdl.sap-ag.de/~sapidp/012002523100006341772011E/cr2008fp35_redist.zip]..
    4.  Execute the app.
    At this stage, the screen shows
    ReportSelectionFormula:
    (   (  NOT  {Orders.Order_Date} >= {?START_DATE}  )   AND   (  NOT  {Orders.Order_Date} <= {?END_DATE}  )   ) 
    The expected value is:
    ReportSelectionFormula:
    (   (  {Orders.Order_Date} >= {?START_DATE}  )   AND   (  {Orders.Order_Date} <= {?END_DATE}  )   ) 
    If we were to repeat the same test above but use the Crystal Reports 2003 SP3 runtime (i.e. no Fix Pack), which can be dowloaded from [https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip], we would get the correct report selection formula. A side-effect for this incorrect report selection formula is a runtime exception complaining about an errorkind and a boolean being expected. 
    Do you know if there is any workaround that I can apply in code, perhaps a different Fix Pack?  Is there a Fix Pack expected to be released soon?  It is not practical for us to update our reports and use a different style in the record selection formula because we have many such reports, and our customers probably have even more.
    Thank you.
    -Carlos.

    Already a known issue, here's the [KB 1584095 - A boolean NOT is added at the beginning of a record selection formula when the report is loaded by the Crystal Reports .NET SDK |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533383334333033393335%7D.do]

  • PDF Export Output in Crystal Reports Developer 10 vs. Crystal Reports Developer XI

    <p>Hi -- First post here, so forgive newbish behavior (at least for today)</p><p>Quick question:</p><p>Why does my output differ (margins and image size) for the same report exported to PDF via Crystal Reports Developer 10 vs. Crystal Reports Developer XI?  It&#39;s the same report with the same data and same design.  When XI is compared to 10, the output in XI seems to remove an extra 1/4-inch on the left, right, top, and bottom margins and makes my images shrink by about a factor of 25%.</p><p>While not the end of the world, it would be nice to get an explanation as to why this happens.</p><p>Thanks in advance,</p><p>Amasis</p>

     I personally haven't noticed that myself but I'm sure it will have been reported to Customer Care if it's a more persistent issue. Have you tried looking this up in the Knowledge Base?
        - Kathryn Webster (Report Design Consultant)Â
               Kat&#39;s News: http://diamond.businessobjects.com/blog/279

  • Total No of pages different in report printed using Crystal Report XI R2 vs SAP Crystal Reports, developer version for Microsoft Visual Studio (File Version 13.8)

    Currently in our application, we are using Crystal Report XI R2 for generating the reports. We are in the process of upgrading the Crystal Report to SAP Crystal Reports, developer version for Microsoft Visual Studio (File Version 13.8). I updated that on my machine and all the reports work fine. I didn't have to modify any of the reports.
    However when comparing the reports, we found that there are few reports on which the total no. of pages differ from the report displayed using Crystal Report XI R2 vs SAP Crystal Reports, developer version for Microsoft Visual Studio (File Version 13.8). Comparing the reports, it looks all the data that were fit on one page earlier with version XI R2 doesn't fit on the same page with version 13.8, thereby increasing the page counts.
    The fonts, page margins everything set on report itself. Nothing being set in the code.
    Both the application is using the same report that is pulling the data from the same database. Our application is a web application.
    Any suggestion, why this is happening.
    Thanks.
    Sanjay

    I am not sure what is being compared here?
    CRXI R2 designer to CRVS?
    CR XI R2 in some version of .NET to CRVS?
    CR XI R2 using RDC SDK to CRVS?
    Also, is this happening on your development computer or after you deploy?
    If you compare the the "Page setup" options dialog between reports that work and those that do not work, do you see any difference?
    Is this a web or a win app?
    Are you seeing the same issue when viewing and exporting - say export to PDF?
    What is the printer driver used and it's version?
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • "Load report failed" after upgrading to Crystal Report for VS 2010

    I switched to Visual Studio 2010 few months ago. Today, I needed to update my Crystal Report reports, so I installed the Crystal Report for Visual Studio 2010 on my local server. I updated my reports and it works fine on my local server.
    On my remote server, I installed the Crystal Report runtime engine for Framework 4.0 (note that my project use the framework 3.5) and published my project. But now I got the following error when I want to create a report "Load report failed". I double-checked the path of my report and its permissions (note that it was working before the update).
    Am I missing a step ?
    Thanks for your help.
    Edited by: David1111_ on Mar 1, 2011 6:08 PM
    Edited by: David1111_ on Mar 1, 2011 6:09 PM

    Googling 'FILE LOCKED WITH ONLY READERS' I came up with the following:
    http://forum.sysinternals.com/topic21378.html
    So, no, that does not appear to be the issue.
    However my assertion - given that the correct dlls are loading - is still that either the report is not there (do you see it loaded in Process Monitor?) or the process has no access to either the actual rpt or the temp files that the print engine creates. Those really are the only reasons for report load errors.
    This being a web app, try a simple win app - as a test. All you need is the viewer and CrystalreportViewer1.ReportSource = <path to report> (use a saved data report). Compile, throw the exe on the server. Run. What happens there?
    - Ludek

  • Crystal Reports XI (11.0) vs Crystal Reports XI R2 (11.5)

    Are there documented difference or compatability issues between Crystal Reports 11.0 components and Crystal Reports 11.5 components?  We are using Crystal Reports XI 11.0 Professional edition, and we have an integrated 3rd party software that has compatability concernts with our version of Crystal XI 11.0. 
    We are wondering if there is any documented component incompatabilities between the compontents of 11.5, and 11.0.  The 3rd party software company states that they are using 11.5 components.
    Thank you for your time.  I am a first time poster, and appreciate any assistance given.

    Hello,
    1st XI R2 is still supported and you can upgrade to R2 for free. Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    Once you get it installed go to the keycode page and request an XI R2 keycode to enable all functionality.
    Check the Businessobjects tab above for more info on the differences.
    Thank you
    Don

  • How to send multiple attachments thru mail?

    I haven't been able to figure out how from the mail application send docs, worksheets etc as attachment. Also how to attach multiple docs in the mail. Looking for help on this.
    Sparashar

    You need to start in the app that contains the files that you want to send as attachments and use that app's functionality to select and attach files to an email, and not start in the Mail app e.g. the GoodReader app supports multiple document types (word and excel, read only, PDFs, text files, pictures) and allows you to select one or more of them and attach/switch with them to an email.
    In the Mail app itself on iOS 6 you can now press and hold the body of the email and select photos from the Photos app to attach to it.

  • How to send multiple Recipients using the mail.jar and activation.jar

    hi!
    could somebody help me. how do i send multiple Recipient using mail.jar. when i would input 2email address in to Recipient
    (example: [email protected], [email protected])
    i get a DEBUG: setDebug: JavaMail version 1.3.2
    but if i send a single email it just works properly.
    heres my code
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public class SendMail
              public SendMail(String to, String from, String subject, String body)
              //public SendMail(String to)
                   String message_recip = to;
                   String message_subject = subject;
                   String message_cc = "";
                   String message_body = body;
                   //The JavaMail session object
                   Session session;
                   //The JavaMail message object
                   Message mesg;
                   // Pass info to the mail server as a Properties, since JavaMail (wisely) allows room for LOTS of properties...
                   Properties props = new Properties( );
                   // LAN must define the local SMTP server as "mailhost" to be able to send mail...
                   //props.put("mail.smtp.host","true");
                   props.put("mail.smtp.host", "mailhost");
                   // Create the Session object
                   session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   try
                        // create a message
                        mesg = new MimeMessage(session);
                        // From Address - this should come from a Properties...
                        mesg.setFrom(new InternetAddress(from));
                        // TO Address
                        InternetAddress toAddress = new InternetAddress(message_recip);
                        mesg.addRecipient(Message.RecipientType.TO, toAddress);
                        // CC Address
                        InternetAddress ccAddress = new InternetAddress(message_cc);
                        mesg.addRecipient(Message.RecipientType.CC, ccAddress);
                        // The Subject
                        mesg.setSubject(message_subject);
                        // Now the message body.
                        mesg.setText(message_body);
                        // XXX I18N: use setText(msgText.getText( ), charset)
                        // Finally, send the message!
                        Transport.send(mesg);
                   }//end of try
                   catch (MessagingException ex)
                        while ((ex = (MessagingException)ex.getNextException( )) != null)
                             ex.printStackTrace( );
                        }//end of while
              }//end of catch
         }//end of SendMail
    public static void main(String[] args)
              //String t = "[email protected], [email protected]"; - this I think causes error
    String t = "[email protected]";
              String f = "[email protected]";
              String s = "Hello World";
              String b = "the quick brown fox jumps over the lazy dog";
              SendMail sm = new SendMail(t,f,s,b);     
         }//end of main
    }//end of class
    could someone please help me im stuck-up with this. thanx!

    i need it ASAP
    i am a beginner in java and jsp
    Need to knw how can I parse the addresss field
    Below
    is the code
    <code>
    package
    public class EMailBean {
    private String smtp,username,password,from,bcc,subject,body,attachments,cc;
         /*setter*/
         public void setSmtp(String str){this.smtp=str;}
         public void setUsername(String str){this.username=str;}
         public void setPassword(String str){this.password=str;}
         public void setFrom(String str){this.from=str;}
         public void setTo(String str){this.to=str;}
         public void setCc(String str){this.cc=str;}
         public void setBcc(String str){this.bcc=str;}
         public void setSubject(String str){this.subject=str;}
         public void setBody(String str){this.body=str;}
         public void setAttachments(String str){this.attachments=str;}
                                  /*getter*/
         public String getSmtp( ){return this.smtp;}
         public String getUsername( ){return this.username;}
         public String getPassword( ){return this.password;}
         public String getFrom( ){return this.from;}
         public String getTo( ){return this.to;}
         public String getCc( ){return this.cc;}     
         public String getBcc( ){return this.bcc;}
         public String getSubject( ){return this.subject;}
         public String getBody( ){return this.body;}
    public String getAttachments( ){return this.attachments;}
    </code>
    Session session = Session.getDefaultInstance(props, null);
    session.setDebug(true);
    try {
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(mail.getFrom()));
                                  msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                                  msg.addRecipient(Message.RecipientType.TO,new InternetAddress(mail.getTo()));
                             msg.addRecipient(Message.RecipientType.CC, new InternetAddress(mail.getCc()));
                                  msg.addRecipient(Message.RecipientType.CC, new InternetAddress("[email protected]"));
    msg.setSubject(mail.getSubject());
    // Create the message part
    BodyPart messageBodyPart = new MimeBodyPart();
    // Fill the message
    messageBodyPart.setText(mail.getBody());
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(mail.getAttachments());
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    msg.setSentDate(new Date());
    Transport t = session.getTransport("smtp");
    try {
    t.connect(mail.getUsername(), mail.getPassword());
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    result = result + "<FONT SIZE='4' COLOR='blue'><B>Success!</B>"+"<FONT SIZE='4' COLOR='black'> "+"<HR><FONT color='green'><B>Mail was successfully sent to </B></FONT>: "+mail.getTo()+"<BR>";
    if (!("".equals(mail.getCc())))
    result = result +"<FONT color='green'><B>CCed To </B></FONT>: "+mail.getCc()+"<BR>";
    if (!("".equals(mail.getBcc())))
    result = result +"<FONT color='green'><B>BCCed To </B></FONT>: "+mail.getBcc() ;
    result = result+"<BR><HR>";
    } catch (MessagingException mex) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+mex.toString()+"<BR><HR>";
    } catch (Exception e) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+e.toString()+"<BR><HR>";
    e.printStackTrace();
    finally {
    return result;
    }

  • Multiple attachments in single mail using XML publisher bursting

    Hi all
    I am sending the PDF generated to a particular mail recipient using the bursting options.
    There is requirement in which I have to attach two different PDF's to the mail. These multiple attachments should go in a single mail. Please let me know how we can achieve this.
    Thanks in adv,
    Srini
    Edited by: 796646 on Mar 4, 2011 2:35 PM

    Suresh,
    just copy your question and paste it in search box.. press enter
    there are too many posts already on this.
    still a little help for you, with explanation:
    [code snipet with documentation|http://wiki.sdn.sap.com/wiki/display/Snippets/MultipleAttachmentsExplanation]

Maybe you are looking for

  • BPM Monitoring: not all messages are groupped my bpm name

    Could you explain me why not all messages are groupped my bpm name? There are messages above bpm name that was sent in this bpm. It is too diffucult to monitor messages in BPM monitoring.

  • Tree expand problem with Accordion Component

    While using Accordion component with creationPolicy="all", tree components which are placed in accordion's different panels, will not expanded at creationcomplete. Trees are created perfectly but not expand its level at initial creationComplete time.

  • Ms Acces using Java

    Hi All I have one doubt. I want to know the primary keys of a table in ms access using java.The same code is working in oracle,db2. i wrote this: import java.sql.*; public class Java1{ public static void main(String args[]){ try { Connection con = nu

  • How to Tuning this sql statement

    hi my friend:                         SELECT    ie.ImportEntityAutoID,                                     ie.ImportRawDataAutoID,                                     ie.Amount,                                     s.NAME AS StatusName,               

  • Outlook notification in performance management

    Hi, In the steps of MSS-Performance Management, I m getting the notifications in UWL.It's working fine. The requirement is to get the email notification in outlook also. How to achieve this, any idea? Thanks,