Hi,
The Sender and receipient both are there.
Below is the Code,
Purch. Rcpt. Line - OnPreDataItem()
CLEAR(SMTPMail);
SMTPSetup.GET;
//SETRANGE("Posting Date",WORKDATE);
Recipients:= 'ABC@CorpXY.com';
Subject := 'Expense Receipt Notification' + ': ' + FORMAT(WORKDATE);
Body := 'Following Items are received on :' + FORMAT(WORKDATE);
CLEAR(SMTPMail);
SMTPMail.CreateMessage('XYZ',SMTPSetup."User ID",Recipients,Subject,'',TRUE);
SMTPMail.AppendBody('Hello,');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<h1>'+ Body + '</h1>');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<table border="1">');
SMTPMail.AppendBody('<tr>');
SMTPMail.AppendBody('<th><b>Document No.</th>');
SMTPMail.AppendBody('<th><b>Order No.</th>');
SMTPMail.AppendBody('<th><b>Item No.</th>');
SMTPMail.AppendBody('<th><b>Description</th>');
SMTPMail.AppendBody('<th><b>Quantity</th>');
SMTPMail.AppendBody('<th><b>Unit Cost(LCY)</th>');
SMTPMail.AppendBody('<th><b>Amount(LCY)</th>');
SMTPMail.AppendBody('</tr>');
Purch. Rcpt. Line - OnAfterGetRecord()
SMTPMail.AppendBody('<tr>');
SMTPMail.AppendBody('<td>' + FORMAT("Document No.") + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT("Order No.") + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT("No.") + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT(Description) + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT(Quantity) + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT("Unit Cost (LCY)") + '</td>');
SMTPMail.AppendBody('<td>' + FORMAT("Unit Cost (LCY)" * Quantity) + '</td>');
SMTPMail.AppendBody('</tr>');
Purch. Rcpt. Line - OnPostDataItem()
SMTPMail.AppendBody('</table>');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('Thanks ');
SMTPMail.AppendBody(' ');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<hr>');
SMTPMail.AppendBody('This is system generated mail. Please do not reply to this mail id.');
SMTPMail.Send;
When i use my ID as user Id in SMTP setup, its working but when i give a particular Notification id, than we have the above error. but this ID is working fine when sending Approval Emails with in NAV.