This content has been marked as final. Show 8 replies
How are you extracting the message id from the e-mail? Do you use the Trim( ) function to remove any possible leading or trailing spaces? CFBREAK will take you out of the loop.
HI i dont need to use trim as the message id is generated by a windows application,no spaces are every present!!
so when i check the log i can see some duplicates of the messageid are the same right after each other,
if i use cfbreak and it takes me out of the loop, would the loop start over again or would the schedule task have to run again?
instead of cfbreak is there a way to delete the email then restart the scheduled task page?
Does the following represent your process flow?
ok many thanks
when you say "if you know how many Windows emaliIds you have"
each email i receive has a different unique windows email id and there is only one per email..
i think my current code maybe processing the email twice in some cases, thats why i am putting this check in place!!
so which would be the best option for me to use?
Probably the second one.
i am just worried why i am getting duplicates from my current code which i have attached below, is it possible that when i do the query GetMessage that if a messageID is inserted in the previous loop is not yet in there?
does my code look ok?
Something to look at - when you delete an e-mail, your ACTION and MESSAGENUMBER attributes do not have a space between them: ACTION="Delete"MESSAGENUMBER="1">
Do a CFDUMP after your first CFPOP, and a CFOUTPUT after your getMessage CFQUERY. This debug results should show you what's going on. See code below.
> <cfset str_idd = trim(listlast(listgetat(mymessage, 7, "|"), "~"))>
> WHERE MainAppMessageID = '#str_idd#'
Isn't the message number already a column in the POP query : queryname.messagenumber