I am trying to send the Mail through nav code mails are sending , but attachment is not attaching wen i writing the follow code
IF SalesLine.FINDSET THEN;
SMTPMail.AppendBody(‘Dear Sir / Madam,\Please find below the Product wise dispatch report on ‘+FORMAT(“Posting Date”)
+’.’+‘InvoicNo. ‘+“No.”+‘Customer PO No’+“Customer Order No.”+’.’+’\The Details of which are attached’ +’.’);
IF EXISTS(‘D:\SAI\Dispatch.xls’) THEN BEGIN
and i want to print the message in next line like
please find the dispatch details
but wen i writing above code using appendbody function the message is not printing in the next line.please help me on this .
Add SLEEP(5000) after
no same problem attachment is not attching.
Maybe there is very little execution time between creation of file, Sending it as Attachment and Deleting it. The File System may not be claring the Handles to the File.
So you can use the SLEEP(value in millisecs) function to put some delay. Try using Sleep befor smtp.attachment function and after smtp.send function.
But some small problem is there in this here mails are sending but the body is appearing as below
“Dear Sir,Please find the attachment details of dispatch” like this
but i want the following format
Please find the attachmnt
Like above means i want please find the attachment details in next line i wrote ‘’ this before please find but it wont work please guide me on this.
Declare two char variables
SMTPMail.AppendBody(‘Dear Sir,’**+Lcha1+Lcha2+’**Please find the attachment details of dispatch’ );