|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Trouble Getting Email UID
I'm working on an automated email processing script and once the mail has been dealt with I need to delete it.
I know I need to use the UID, however getting it is proving to be a little tricky. When I do a dump of the "pop" variable scope I see the UIDs. When I try to programmatically add them to an array so I can loop through them for deletion my array is populated with emptiness. That is, the array has a number of elements equal to the number of emails in the box, but they have no value. Here's a bit of code: Code:
<cfset uid_arr = arrayNew(1)>
<cfloop query="pop">
<cfset arrayAppend(uid_arr, pop.UID)>
</cfloop>
<cfoutput>#arrayToList(uid_arr)#</cfoutput>
On the line: Code:
<cfset arrayAppend(uid_arr, pop.UID)> I've tried lots of different ways of trying to get the array to except the value, all to no avail. Any ideas or suggestions appreciated. |
|
#2
|
||||
|
||||
|
Quote:
Have you tried this? Code:
<cfset uid_arr = arrayNew(1)>
<cfloop query="pop">
<cfset uid_arr = arrayAppend(uid_arr, pop.UID)>
</cfloop>
Dealing with CF is like a battle between good and evil sometimes, I feel. |
|
#3
|
||||
|
||||
|
Yep, that throws a Boolean cannot be used as an array. Maybe I need to use:
Code:
<cfset uid_arr[i] = appendArray(uid_arr, pop.UID)> And then control the incrementing myself. But on the other hand, I'm not sure there's anything wrong with how I'm adding to the array to begin with. When I just try to cfoutput pop.UID it comes out blank. ![]() |
|
#4
|
||||
|
||||
|
OK, just to add to the fun....
When I send emails to the test address and do a dump of the values, I see a UID for each email. Up until now I had been using my company email account for testing and I couldn't get the UID into the array. I just tried sending from my Yahoo account and lo and behold, the UID is in the dump and the array! What does this mean? All of the email this thing will get in production is going to come from inhouse so I have to make it work with internal email. Last edited by wdn2000 : November 10th, 2004 at 01:05 PM. |
|
#5
|
||||
|
||||
|
No takers, huh?
![]() Ok, I decided to use the MESSAGENUMBER instead of the UID. I've heard there are drawbacks to this approach but at least I can get the MESSAGENUMBER whereas the UID wasn't working so well. Now, using the MESSAGENUMBER, when I try to delete a message nothing happens. By that, I mean the code executes, no errors are thrown, but the messages remain in the inbox. Any ideas? |
|
#6
|
|||
|
|||
|
Quote:
The problem is a simple one, you don't assign the arrayAppend() function to the array. The function itself returns a boolean true or false to show whether the variable was appended to the array. You just do this: <cfset arrayAppend( uid_arr, pop.UID ) />
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#7
|
||||
|
||||
|
Quote:
Yup, that's how I was doing it. I only put it the other way to show it didn't work. Strangely enough when I get the messages from a *NIX POP server everything works as it should, however in production it has to get it from a Lotus Notes server running on Windows. The problems seem to have to do with how Lotus implements the POP standard. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Trouble Getting Email UID |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|