Hi ZHU,
I use that it is working but in the mention code i use html template to sent mail to customer in this code i read blob file and replace all the percentile value and sent mail but it sent blank mai to customer can you plaease check the code why the template is not is sent to customer
Documentation()
OnRun()
SentMailWithTemplate(CustNo : Code[20])
Customer.RESET;
Customer.CALCFIELDS("Balance (LCY)");
Customer.SETFILTER(Balance,'>%1',0);
IF Customer.FINDSET THEN
Customer.TESTFIELD("E-Mail");
TemplatesTable.CALCFIELDS(ImportTemp);
IF TemplatesTable.GET('141')THEN
Rec.CALCFIELDS(ImportTemp);
IF Rec.ImportTemp.HASVALUE THEN
Rec.ImportTemp.CREATEINSTREAM(Ins);
StreamReader:=StreamReader.StreamReader(Ins);
EmailTemplateBody:=StreamReader.ReadToEnd();
StreamReader.Close();
NotificationBodyString:=NotificationBodyString.Copy(EmailTemplateBody);
NotificationBodyString := NotificationBodyString.Replace('%SoftwareName%',SoftwareNameTxt);
TextTable:=NotificationBodyString.ToString;
TextTable:=STRSUBSTNO(TextTable,'%%CustomerName%%',Customer.Name);
TextTable:=STRSUBSTNO(TextTable,'%%CustomerAddress%%',Customer.Address);
TextTable:=STRSUBSTNO(TextTable,'%%ContactNo%%',Customer.Contact);
TextTable:=STRSUBSTNO(TextTable,'%%Date%%',TODAY);
TextTable:=STRSUBSTNO(TextTable,'%%Email%%',Customer."E-Mail");
TextTable:=STRSUBSTNO(TextTable,'%Home%','<a href="https:/.../a>');
TextTable:=STRSUBSTNO(TextTable,'%About%','<a href="https:/.../a>');
TextTable:=STRSUBSTNO(TextTable,'%ContactUs%','<a href="www.flipkart.com/.../">Contact Us</a>');
SMTPSetup.GET();
SMTPMail.CreateMessage('',SMTPSetup."User ID",Customer."E-Mail",'Test1','',TRUE);
IF Customer."E-Mail"<>'' THEN
SMTPMail.AddCC(Customer."E-Mail");
SMTPMail.AppendBody(TextTable);
SMTPMail.Send;