Attaching all PDFs in one mail? Having only one Body

Dear All,
I managed to develop a code which enable me to send a mail for each selected line in my table. The problem is it send to me for each line  a separate E-mail "each line has a PDF ". I just want to send only one mail for all PDFs attachments.
Code:
foreach (vw_CustLedgerEntryItem1 item in _ItemsList.SelectedItems)
//you would normally process each row
//but here we're just concatenating the properties as
//proof that we are processing the selected rows
//vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem;
InvSendbyMailRequestBody reqBody = new InvSendbyMailRequestBody(
item.Document_No_
, item.Report_Type
, "DynNavHRS"
, this.Application.User.Name.Replace(@"HRS\", "") + "@hrs.com" // HRS001
, "Document"
, false
, false
, this.vw_CustomerItem.ISO_Code // Change 7.8.2014 Bug in Email body text sprache
, this.vw_CustomerItem.Salesperson_E_mail // Change 7.8.2014 Bug in Send E-mail
, item.Customer_No_.ToString()
, false
, "XYZ"
, false);
InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
HRSReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
wsHRS.InvSendbyMailAsync(req);
this.ShowMessageBox("Your email was successfully sent");
any idea how can I send the attachment only in one mail ? My guess is that I have to take out this part out of my loop ? but its not working :(
InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
HRSReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
wsHRS.InvSendbyMailAsync(req);
Thanks a lot,
Zayed

HI Zayed,
If you want to send an email with attachments in Lightswitch, you could consider using System.Net.Mail with
Attachment Class. For example:
attachment1 = pathToFirstAttachmentFile;
attachment2 = pathToSecondAttachmentFile;
// create and add first attachment to collection
Attachment data = new Attachment(attachment1, MediaTypeNames.Application.Octet);
m_MailMessage.Attachments.Add(data);
// create and add second attachment to collection
Attachment data2 = new Attachment(attachment2, MediaTypeNames.Application.Octet);
m_MailMessage.Attachments.Add(data
Best regards,
Angie
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I get duplicate e-mails having only one active address

    IF I RECEIVE AN E-MAIL TWICE HOW DO I DROP ONE OF THEM FROM MY E-MAIL MESSAGES?

    hello,
    d_fisher meant Shift + trackball.
    Alt + Trackball = Page up / Page down.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Why does closing all open windows (15) and leaving only one drop ram usage from 1.5 to 1.4Gb and not more.

    Why does closing all open windows (15) and leaving only one drop ram usage by only 100mb from 1.5 to 1.4Gb.
    What is in this 1.4 gb ?
    I don't care much about ram, It's just that cpu usage spike like crazy by the end.
    ''Edited to remove swearing - TonyE''

    Hi musicfan,<br />Sorry you are having problems with Firefox. Maybe you should have asked earlier and we could have fixed it.
    Reading your comments I do not see that rolling back to an insecure Firefox 22 will actually help you much. You are probably best using IE, unless you have also damaged that.
    *[[Export bookmarks to Internet Explorer]]
    You should not use old versions they are insecure. Security fixes are publicised and exploitable.
    * [[Install an older version of Firefox]]
    * https://www.mozilla.org/security/known-vulnerabilities/firefox.html
    Most others will not be having such problems. We are now able to say that with confidence because after developers missed a regression in Firefox 4 telemetry was introduced so that data was obtained. It may be an idea to turn on your telemetry, if you have not already done so, and decide to stick with Firefox.
    *[[Send performance data to Mozilla to help improve Firefox]]
    Trying safe mode takes seconds. Unfortunatly if you are not willing to do even rudimentary troubleshooting there is not anything we can do to help you.
    *[[Troubleshoot Firefox issues using Safe Mode]]

  • HT201342 i have a 10.6.8 mac os x system in a intel processor computer. how can I addressbook contacts to icloud. I tried exporting my  import my addressbook and failed, then exportind a vcard from all contacts and failed and finale only one vcadr and fai

    i have a 10.6.8 mac os x system in a intel processor computer. how can I addressbook contacts to icloud. I tried exporting my  import my addressbook and failed, then exportind a vcard from all contacts and failed and finale only one vcadr and failed. Something might i doing wrong

    I just had the same problem, I've updated to 10.6.8 yesterday, and since then the browsing are very slow, no matter what broswer I am using, the upload download speed are still the same. But browsing just take forever, It takes for example google.com 30 seconds to load. I have Extream high speed internet connection, 3 other computers, and the only one is having this problem is the Mac after the update.
    Something in this update screwed my browsing capabitilties, I tried downloading Crome browser, same issue.
    I hope there is a way beside TimeMachine to revert the latest update. I don't want to reformat as I am sure as soon as I am going to do the update it will cause the same problem.
    Model Name:    iMac
      Model Identifier:    iMac11,3
      Processor Name:    Intel Core i7
      Processor Speed:    2.93 GHz
      Number Of Processors:    1
      Total Number Of Cores:    4
      L2 Cache (per core):    256 KB
      L3 Cache:    8 MB
      Memory:    12 GB
      Processor Interconnect Speed:    4.8 GT/s
      Boot ROM Version:    IM112.0057.B00

  • HT3819 I am moving back home to live ,currently I have ipad2 ,4s iPhone ,wife 4s and daughter iPhone 5 ,pad 4th gen and iPod touch ..all different iTunes account s but only one invoice which is mine ...can we share and if so how ?

    I am moving back home to live ,currently I have ipad2 ,4s iPhone ,wife 4s and daughter iPhone 5 ,pad 4th gen and iPod touch ..all different iTunes account s but only one invoice which is mine ...can we share and if so how ?

    How to use multiple iPods, iPads, or iPhones with one computer
    http://support.apple.com/kb/HT1495
    How To Best Use and Share Apple IDs across iPhones, iPads and iPods
    http://www.nerdsonsite.com/blog/2012/06/07/help-im-appleid-confused/
     Cheers, Tom

  • Ok, So I just purchased a song, and we it got done loading. I went to listen to it and It wouldn't play at all. This isn't the only one I bought a song that will only play half way. What can I do to fix this?

    Ok, So I just purchased a song, and we it got done loading. I went to listen to it and It wouldn't play at all. This isn't the only one I bought a song that will only play half way. What can I do to fix this?

    Hi..
    Try re downloading the song.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if I

    I need to edit out parts of a song to cut it down to two minutes for my daughter's talent show. I went to info/start time and it will cut down one part but only one part. I need to put three parts together. I tried adding duplicates of the song to the list but if If I change the start time on one it will change it on all of them.

    In your library, right-click the song you want to edit.
    select "get info".
    go to "options" and select the start and stop times for your first section of the song.
    click "OK".
    Find the shortened version of the song in your library. It may take a minute for it to show up. right click it again and select "create (????) version". (the ???? is different for different formats).
    The library will spit out a new, second version of the song which you can rename. I suggest you use the original title and add a 1 to the end.
    Now you can go back to the other version and repeat the process with a different  start/stop time.
    Once you are done editing, you can burn all of your versions to a disk, just make sure your interval time is zero so there are no gaps between edits.
    To keep the orginal song on your library, just go back to the original and put the start/stop times back to the original settings.

  • Inline HTML + Inline Text + attachment all 3 in 1 mail  in Outlook

    Hello All,
    I am trying to compose and send a mail using JavaMail library using which I can send a mail with
    1) HTML in the body of the mail
    and
    2) 4 -5 line of text (along with HTML , not as alternative text)
    and
    3) an attachment (which will also be an HTML file )
    Now here are the issues I am facing --
    --> When I try to view above composed mail in Outlook it shows either the text or HTML depending on whichever i add first to the MimeMultipart object using addBodyPart(). I wish to view both in Outlook.
    --> As I am attaching the same HTML file and displaying the same in body is there a way to do both using same file hence keeping the size of mail does not contain the size of HTML file only once , not twice .
    here is the code I am trying to use . Any kind of advice or corrections would be greatly appreciated.
    BufferedReader in = new BufferedReader(new FileReader("filename.html"));
            String tempStr;
            String finalStr="";
            while ((tempStr = in.readLine()) != null)
               finalStr= finalStr + tempStr+"\n" ;
            in.close();
            Multipart mp = new MimeMultipart();
            MimeBodyPart mbp1 =  new MimeBodyPart();
            mbp1.setContent(finalStr, "text/html");
            mbp1.setDisposition(Part.INLINE);
            mp.addBodyPart(mbp1);
            MimeBodyPart mbp2 =  new MimeBodyPart();
            mbp2.setContent("\n\nPlease open attachment if html not viewable in body\n\n","text/plain");
            mbp2.setDisposition(Part.INLINE);
            mp.addBodyPart(mbp2);
            String       attachfilename = "filename.html";
            MimeBodyPart mbp3           = new MimeBodyPart();
            DataSource   fds            = new FileDataSource(attachfilename);
            mbp3.setDataHandler(new DataHandler(fds));
            mbp3.setFileName(attachfilename);
            mbp3.setHeader("Content-Type" , "text/plain");
            mp.addBodyPart(mbp3);
            message.setContent(mp);Thanks

    Hello bshannon
    As you said that "Different mailers will display the same content in different ways." i was wondering if any of the outlook will be able to display more than one mimebodypart(s) if a mail is sent using javamail or is Outlook suposed to show just one body part
    I read this text on wikipedia for Outlook [http://en.wikipedia.org/wiki/Outlook_Express]
    "Handling of PGP/MIME signed messages
    Outlook Express does not correctly handle MIME,[4] and will not display the body of signed messages inline. Users get a blank e-mail and two attachments (one of the message text and one of the signature) and therefore need to open an attachment to see the e-mail. If the email has been forwarded several times, users need to open attached email messages one inside the other multiple times till they reach the parent e-mail message. This bug has still not been rectified."
    So does the above bug applies to the mails sent by JavaMail ?
    Thanks

  • Attaching multipage .pdf file in Mail

    How do I attach a multipage .pdf file in Mail?  I am running OSX 10.8.2 on a MacBook Pro.  When I try to attach only the frst page attaches.

    Are you sure?
    When you add the multi-page attachment to your email only the first page shows. If you click on that first page to select it and then right click and choose Quick Look Attachemnt you should be able to see that all pages are there.
    Matt

  • Apple Mail downloads only one mail at a time...

    Hi Everybody,
    My PowerBook runs on Tiger 10.4.11. And I have Apple Mail version 2.1.3, which I have configured to my gmail account.
    Just a few days back I noticed something very peculiar about the download habit of Apple Mail which now downloads only one mail (this has started a few weeks back). Irrespective of how many mails there are on my gmail, when I press 'get mail' button, it connects to my gmail account and shows & downloads only one mail(the first in the row). Now, when I figured out the problem I have to press the 'get mail' button again and again till there are no more mails to download. It actually downloads all mails based on the receipt time, but only one at a time.
    Does anyone here have any idea what this could be. I really look forward to sorting this out.
    Thanks in advance
    Malaya

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    The usual reason why updates fail or mess things up, is if Permissions are not fixed before & after every update, with a reboot... you may get a partial update when the installer finds it doesn't have Permissions to change one obscure little part of the OS, leaving you with a mix of OS versions.
    Some people get away without Repairing Permissions for years, some for only days.
    If Permissions are wrong before applying an update, you could get mixed OS versions, if Directory is the slightest messed up, who knows!
    If many Permission are repaired, or any Directory errors are found, you may need to re-apply some the latest/biggest updates.
    May even need to do an Archive and Install if you have room on the HD...
    http://docs.info.apple.com/article.html?artnum=107120
    I only use Software Update to see what is needed, then get them for real via...
    http://www.apple.com/support/downloads/
    That way I can wait a week or so, check the forums for potential problems, and get Permissions & such in order before installing.

  • PDF file not generating for only one Invoice billing document

    Hi all,
    We have upgraded our system into ECC6.0 from 4.7 version. During our Testing time, we have found the following Bug:
    Bug: Not possible to get output in pdf format for only one  Invoice type(TR code: VF02) except for all it is generating PDF output.
    Can anybody help me out to find the route cause for this problem.
    Regards,
    Murali.

    Hi,
    For one Billing-Invoice type , PDF is not generating. But it is generating for other Invoices.
    So should i need to go through the Printer settings?
    Regards,
    Murali.

  • Attach a PDF in SAP mail

    I have a PDF document and send as Email using fm SO_NEW_DOCUMENT_ATT_SEND_API1. How do we attach a pdf which is saved on hardisk to sap mail ?
    Thanks in advance.

    A similar case was handled in the following code.
    REPORT Z_SCRIPT .
    DATA: itcpo LIKE itcpo,
          tab_lines LIKE sy-tabix.
    Variables for EMAIL functionality
    DATA: maildata   LIKE sodocchgi1.
    DATA: mailpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: mailhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: mailbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: mailrec    LIKE somlrec90 OCCURS 0  WITH HEADER LINE.
    DATA: solisti1   LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    PERFORM send_form_via_email.
          FORM  SEND_FORM_VIA_EMAIL                                      *
    FORM  send_form_via_email.
      CLEAR:    maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
      REFRESH:  mailtxt, mailbin, mailpack, mailhead, mailrec.
    Creation of the document to be sent File Name
      maildata-obj_name = 'TEST'.
    Mail Subject
      maildata-obj_descr = 'Subject'.
    Mail Contents
      mailtxt-line = 'Here is your file'.
      APPEND mailtxt.
    Prepare Packing List
      PERFORM prepare_packing_list.
    Set recipient - email address here!!!
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      APPEND mailrec.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = maildata
                put_in_outbox              = ' '
           TABLES
                packing_list               = mailpack
                object_header              = mailhead
                contents_bin               = mailbin
                contents_txt               = mailtxt
                receivers                  = mailrec
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                OTHERS                     = 99.
    ENDFORM.
         Form  PREPARE_PACKING_LIST
    FORM prepare_packing_list.
      CLEAR:    mailpack, mailbin, mailhead.
      REFRESH:  mailpack, mailbin, mailhead.
      DESCRIBE TABLE mailtxt LINES tab_lines.
      READ TABLE mailtxt INDEX tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
    Creation of the entry for the compressed document
      CLEAR mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      APPEND mailpack.
    Creation of the document attachment
    This form gets the OTF code from the SAPscript form.
    If you already have your OTF code, I believe that you may
    be able to skip this form.  just do the following code, looping thru
    your SOLISTI1 and updating MAILBIN.
      PERFORM get_otf_code.
      LOOP AT solisti1.
        MOVE-CORRESPONDING solisti1 TO mailbin.
        APPEND mailbin.
      ENDLOOP.
      DESCRIBE TABLE mailbin LINES tab_lines.
      mailhead = 'TEST.OTF'.
      APPEND mailhead.
    Creation of the entry for the compressed attachment
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'OTF'.
      mailpack-obj_name = 'TEST'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      APPEND mailpack.
    ENDFORM.
         Form  GET_OTF_CODE
    FORM  get_otf_code.
      DATA: BEGIN OF otf OCCURS 0.
              INCLUDE STRUCTURE itcoo .
      DATA: END OF otf.
      DATA: itcpo LIKE itcpo.
      DATA: itcpp LIKE itcpp.
      CLEAR itcpo.
      itcpo-tdgetotf = 'X'.
    Start writing OTF code
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                form     = 'Z08V3_COLLI'
                language = sy-langu
                options  = itcpo
                dialog   = ' '
           EXCEPTIONS
                OTHERS   = 1.
      CALL FUNCTION 'START_FORM'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                window        = 'MAIN'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
    Close up Form and get OTF code
      CALL FUNCTION 'END_FORM'
           EXCEPTIONS
                error_message = 01
                OTHERS        = 02.
      MOVE-CORRESPONDING itcpo TO itcpp.
      CALL FUNCTION 'CLOSE_FORM'
           IMPORTING
                result  = itcpp
           TABLES
                otfdata = otf
           EXCEPTIONS
                OTHERS  = 1.
    Move OTF code to structure SOLI form email
      CLEAR solisti1. REFRESH solisti1.
      LOOP AT otf.
        solisti1-line = otf.
        APPEND solisti1.
      ENDLOOP.
    ENDFORM.
    Check it,it may help u.
    Regards

  • Exporting from Thunderbird to Mac Mail and only one email comes across. Confused?, exporting from Thunderbird to Mac Mail and only one email comes across. Confused?

    I am trying to export email from THunderbird to Mac Mail - all seems to go well but only 1 email is imported in Mac Mail. Any solutions would be greatly appreciated

    You might have more luck creating a Gmail account, uploading all your mail there, and then using IMAP access.
    Then you have easy access to your email from any device, and Gmail integrates really nicely with all your IOS devices as well.
    Just remember to set Gmail up as an Exchange Account"

  • Unwanted screen heading(Tab) in a screen set having only one screen.

    Hello Experts,
    We are at the initial phase of go live of SAP Work Manger-6.0 for one of our client.
    We found one strange behaviour as mentioned below.
    We have one screen set(at bottom),which is part of a tile view(contains two screen sets), The screen set at bottom contains only one platform(Ipad) and only one detail screen(buttons at the bottom of the screen).
    It works perfectly fine but sometimes the look and feel gets distorted, which causes an issue to the end users.
    I mean, some times the screen appears as a tab with a black row and a blank yellow box(as highlighted in red in the 2nd screen). Which reduces the size of the screen and hence the buttons become very small in size.
    Details :-
    SMP Server-2.3 SP05
    SAP Work Manger-6.0
    Agentry Client-6.1.5.49 (WPF)
    PFA screen shots for both the cases.
    1.  expected look and feel.
    2.     Unwanted look and feel.
    We need your expert advice to resolve this issue, Please help!!
    Thanks,
    Sudhir.

    Thank you so much Bill!!
    This setting is already there.
    PFA screen shot of the same setting in Agentry.
    Please suggest, If you are referring any thing else.
    Thanks,
    Sudhir.

  • How can i devlope three JSPX pages & having only one backing bean.

    Hello Team,
    I am working on Jdevloper11g
    I have one form registration in this from user enters the self information in first screen, insurance information in second screen, employment information in third screen
    So I developed the following scenario
    I create one JSPX page & in this page I taken 3 panelGroupLayout n I simply rendering the panelGropuLayout that time its very essay stuff.......
    But now I have to implement the af:train component in that I have to implement above scenario in three JSPX pages & I want only one backing bean for this three JSPX pages.
    SelfInformation.jspx ...... SelfInformation.java
    InsuranceInformation.jspx
    EmploymentInformation.jspx
    I done this too…
    But now I want when
    I adding some components on second screen ex af:inputText its backing bean create in SelfInformation.java
    Is this possible?

    HI..
    I created three jspx pages...& i drag n drop af:train & af:trainButtonBar camponant.... by default Back & next button is created...But my requirment is...Only on first form i dont want to show Back Button...
    How can i do this?
    Edited by: Charu on Nov 22, 2009 9:42 PM

Maybe you are looking for

  • Privilege settings how to fix them and what are they

    trying to download itunes gives me a privilege error message

  • Writing special characters

    Hello, I recently got this MacBook Pro and I'm really happy with it, but there's one thing bothering me. I speak some Swedish and because of this, I need to use the characters ä, ö and å. However, writing the å is giving me some problems. According t

  • Configure site auditing in sharepoint online using powershell or Client object model

    Is the any way to configure site collection audit settings in sharepoint online programmatically or using powershell.

  • ASSET  DEPRETIATION

    Dear SAP Gurus, My client wants to sell an asset (date of sale 10th May 2007) He is yet to take the depreciation run for May-07. How/where should he put this date (10th May) so that at the time of depn run system calculates depreciation for 10 days o

  • Cannot Download in App Store

    Help Guys, I cannot download apps using my iPhone. I already have an apple ID, keep on giving me "Authorization Failed. Please connect to iTunes" even if I am connected. Any suggestion?