That is data it shown in mail but I want import data into excel sheet while sending mail and send particulat vendor.
OnRun() SMTPSetup.GET; PurchRcptLine.RESET; PurchRcptLine.SETRANGE("Qty. Rcd. Not Invoiced",PurchRcptLine."Qty. Rcd. Not Invoiced"); PurchRcptLine.SETFILTER(PurchRcptLine."Qty. Rcd. Not Invoiced",'>0'); VendNo:='10000'; Vendor.GET(VendNo); Vendor.TESTFIELD("E-Mail"); SMTPMail.CreateMessage(SMTPSetup."Email Sender Name",SMTPSetup."Email Sender Email",Vendor."E-Mail",'Test Pending Receipt','',TRUE); SMTPMail.AppendBody('<table border="1">' ); SMTPMail.AppendBody('<tr><th>Vendor No</th><th>Document No</th><th>No</th><th>Qty</th></tr>' ); IF PurchRcptLine.FINDFIRST THEN BEGIN REPEAT SMTPMail.AppendBody('<tr><td>'+ PurchRcptLine."Buy-from Vendor No." +'</td><td>'+ PurchRcptLine."Document No." + '</td><td>'+ PurchRcptLine."No." +'</td><td> '+PurchRcptLine."No." +' </td> </tr>' ); UNTIL PurchRcptLine.NEXT=0; SMTPMail.Send; MESSAGE('Mail Send'); END
*This post is locked for comments