Not yet rated

Problem

By default when using “listAllFolders” in Gmail using CFImap, some key folders like “Drafts” and “Sent Mail” do not show up.

Solution

To get the system folders you have to target the folder: "[Gmail]."

Detailed explanation

I 'm not sure the reason though it likely has something to do with the fact that Gmail works with "Labels" and not folders.  The solution is to know what to target. To get the system folders you have to target the folder: "[Gmail]" as in the code sample below:

<cfsetting showdebugoutput = true enablecfoutputonly="false" />

<cfimap action="open" server="imap.gmail.com" secure="true"
username="#username#" password="#password#" connection="imap" >

<cfimap action="listallfolders"  connection="imap"
                                recurse="true" name="temp" folder="[Gmail]" >

<cfimap action="close" connection="imap" />

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes