Hi all,
Imagine this possible situation
I have contact A with e-mail X, and contact B with same e-mail X.
I'm making a a function to go though all contacts and send an email, but in this case i don't wan't that contact B receive another e-mail.
Contact.RESET;
Contact.SETRANGE("No.","No.");
Contact.SETFILTER(Contact."E-Mail",'<>%1','');
IF Contact.FINDSET THEN REPEAT
Recipients:=Contact."E-Mail";
//Recipients:='roliveira@sameca.com';//
SMTPMailSetup.GET;
SMTPMail.CreateMessage(
'',
'roliveira@sameca.com',
Recipients,
TestMailTitleTxt1,
STRSUBSTNO(
MailBody,
USERID),TRUE);
SMTPMail.Send;
UNTIL Contact.NEXT=0;
Im thinking of using a temp table and whenever an e-mail is sent the address will be inserted in that table and then check before send the e-mail if it already exists in the table.
Would like to read some opinions. Thanks
Comments
May be you need to add a new column but it's fine, Temp tables will effect Performance!!
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/