|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
<CFPop> with specific folders?
Hello folks,Qing Xia 02/06/10 10:12 P > Does anyone know of a way to get/delete emails in aJustin Scott 02/06/10 11:32 P > If memory serves, POP has no concept of folders.Leigh 02/07/10 12:20 A Hi Qing Xia,Aaron Neff 02/07/10 04:57 A Well, well, this just proves my theory--ColdFusion has a tag forQing Xia 02/07/10 12:12 P Good tips about gmail. Thanks Aaron!Leigh 02/07/10 01:49 P >Good tips about gmail. Thanks Aaron!Aaron Neff 02/07/10 04:15 P - When polling Gmail, the item counts returned by cfimap may not match theQing Xia 02/07/10 08:28 P > about the undocumented cfpdfform 'name' attribute!Leigh 02/07/10 08:59 P Hello folks, Does anyone know of a way to get/delete emails in a *specific* folder, of a POP email account? It seems that this cannot be done alone (or at all) with the <cfpop> tag. For example, say I want to download all email messages in my "CFTalk" folder off my Gmail account...how would I go about doing that? I know this can be done to emails sitting on an exchange server through the <CFExchangeEmail> tag but I can't think of a way to do that with a POP email account. Any thought is welcome and most appreciated! Thanks, Qing Xia > Does anyone know of a way to get/delete emails in a > *specific* folder, of a POP email account? If memory serves, POP has no concept of folders. When you connect via POP, the server gives you access to the main inbox, but that is all. Any access to folders would have to be through another protocol such as IMAP, or as you mentioned, the Exchange-specific tags. Google does allow IMAP connections, but I have never tried to access Gmail via IMAP from ColdFusion. I would assume that it would work though. -Justin Scott > If memory serves, POP has no concept of folders. Yes, that is my recollection as well. > but I have never tried to access Gmail via IMAP from > ColdFusion. I would assume that it would work though. Neither had I until five minutes ago ;) But I just tried it with cfimap it worked fine. http://mail.google.com/support/bin/answer.py?hl=en&answer=75725 <form method="post"> user <input type="text" name="user" value="myusername@gmail.com"> password <input type="password" name="pw"> folder <input type="text" name="folder" value="SomeFolderName"> <input type="submit"> </form> <cfif structKeyExists(FORM, "pw")> <cfimap action="open" server = "imap.gmail.com" username = "#form.user#" secure="yes" port="993" password="#form.pw#" connection="gConnect" > <cfimap action="GetHeaderOnly" folder="#form.folder#" connection="gConnect" name="qMessages"> <cfdump var="#qMessages#"> <cfimap action="close" connection="gConnect"> </cfif> -Leigh Hi Qing Xia, If you wish to use cfimap w/ Gmail, here are a couple of things you may want to watch out for: - When polling Gmail, the item counts returned by cfimap may not match the same in Gmail (Gmail bug). - When retrieving emails from Gmail, an email labeled x times, may be downloaded x times (Gmail quirk). However, you should not see these issues if you use cfimap to connect to an IMAP-compliant mail server (instead of Gmail). Thanks!, -Aaron Neff >say I want to download all email messages in >my "CFTalk" folder off my Gmail account...how would I go about doing that? Well, well, this just proves my theory--ColdFusion has a tag for EVERYTHING! [?] I've got CF8 running on my personal development machine because I am preparing for the certificate exam. I'm going to install CF9 instead and try this out! Thanks!! You guys are the best! On Sun, Feb 7, 2010 at 4:48 AM, Aar ----- Excess quoted text cut - see Original Post for more ----- Good tips about gmail. Thanks Aaron! >Good tips about gmail. Thanks Aaron! You're very welcome Leigh, and, likewise, thanks very much for the tip (the other day in the Adobe forums) about the undocumented cfpdfform 'name' attribute! I meant to follow-up on that thread w/ some more info, but lost track. I will tho.. soon! Hope the cfimap tag works for you Qing Xia! Take care, -Aaron - When polling Gmail, the item counts returned by cfimap may not match the same in Gmail (Gmail bug). You are right on this one, Aaron. Gmail groups messages by "conversation", which is really just the email subject lines. For example, I've got this Gmail folder that has 8 "conversations" but 15 individual email "messages". However, when I used CFImap to download all messages in that folder, I got only 10! Upon closer examination, I saw that this is because 5 of the email messages are from me myself but they got grouped in the "conversations" because they share the subject lines with those who legitimately belong in this folder. I guess if you think about this, it sort of makes sense since the email messages sent by me are really in the "sent" folder and they only appear in the "conversation" groups for the sake of completeness. But this grouping really does create confusion. - When retrieving emails from Gmail, an email labeled x times, may be downloaded x times (Gmail quirk). Yep, you are right on this, too. I guess this is another hazard of the Gmail system of virtual folders/labels, where a message can have multiple labels. Not necessarily a bad thing but definitely something to watch out for. However, you should not see these issues if you use cfimap to connect to an IMAP-compliant mail server (instead of Gmail). Yep, Yahoo has no problem with these issues since they don't allow 1-to-many relationship between email messages and folders. BTW, it is disappointing that CFImap does not allow lists in the "folder" attribute. You've got to use the <cfimap action="GetHeaderOnly"...> tag twice to get two folders. Maybe something to add to the wish list for CF10! [?] Great ideas Aaron, thanks for sharing! Thanks Leigh for the code example, that really helped. > about the undocumented cfpdfform 'name' attribute! Funny, I did not even realize it was _not_ documented for cfpdfform until you said that. At least that explains why I did not suggest it originally. I was hoping it might just be an omission in the documentation. But I cannot tell much from the error messages. They are giving mixed signals ;-) 1) Required attributes: 'action,source'. Optional attributes: 'destination,name,overwrite,overwritedata,xmldata'. 2) Attribute validation error for tag CFPDFFORM. It does not allow the attribute(s) NAME. The valid attribute(s) are ACTION,FDFDATA,OVERWRITE,RESULT,SOURCE,XMLDATA. (Make up your mind folks..) -Leigh
|
March 20, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||