仅为所有附件发送一封邮件C#" Light switch 2011"?

时间:2015-03-18 09:27:35

标签: c# email email-attachments visual-studio-lightswitch

我设法开发了一个代码,可以让我为表中的每个选定行发送邮件。问题是它为每行发送一封单独​​的电子邮件"每行都有一个PDF"。我只想为所有PDF附件发送一封邮件。

enter code here
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");
    }

如何只有一封电子邮件包含所有附件而不是2封邮件? 请帮忙。

非常感谢, 扎耶德

0 个答案:

没有答案