<cfimap>
Retrieves and deletes e-mail messages from an IMAPmail server.
This tag works exactly the same way as the <cfmail> tag. It has the same attributes.
The Internet Message Access Protocol or IMAP is one of two of the most prevalent Internet standard protocols for e-mail retrieval, the other being POP3. Virtually all modern e-mail clients and servers support both protocols as a means of transferring e-mail messages from a server, such as those used by Gmail, to a client, such as Mozilla Thunderbird and Microsoft Outlook.
Many implementations of webmail use IMAP to retrieve e-mail messages from a server and display them within a web browser, making the use of this protocol transparent to the user.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfimap
connection=string
server=string
port=number
uid=string
username=string
password=string
secure=boolean
action=getHeaderOnly|getAll|delete|open|close|markRead|createFolder|deleteFolder|renameFolder|listAllFolders|moveMail
name=string
messagenumber=string
attachmentpath=string
timeout=number
maxrows=number
startrow=number
debug=boolean
generateuniquefilenames=boolean
folder=string
newfolder=string
recurse=boolean
delimiter=string
>
Unimplemented Attribute(s)
Attribute | Description | Default |
---|---|---|
debug
boolean,
optional
|
this attribute is deprecated and ignored, log control happens via the logging framework directly. * deprecated * |
Examples
Action getAll
<cfimap
action="getAll"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#"
name="getAll" maxrows ="10" attachmentpath="#expandpath('./')#" generateuniquefilenames="true">
<cfdump var="#getAll#" />
Action getHeaderOnly
<cfimap
action="getHeaderOnly"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#"
name="getHeader" maxrows ="10">
<cfdump var="#getHeader#" />
Action CreateFolder
<cfimap
action="CreateFolder"
folder="NewFolderFromIMAP_Test"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#"
name="CreateFolder">
Action ListAllFolders
<cfimap
action="ListAllFolders"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#"
name="ListAllFolders" maxrows ="10">
<cfdump var="#ListAllFolders#" />
Action renamefolder
<cfimap
action="renamefolder"
folder="NewFolderFromIMAP_Test"
newFolder="RenameFolderFromIMAP"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#">
Action deletefolder
<cfimap
action="deletefolder"
folder="NewFolderFromIMAP_Test"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#"
maxrows ="10">
Action MoveMail
<cfimap
action="MoveMail"
Newfolder="newfolder"
messagenumber ="1"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#">
Action MarkRead
<cfimap
action="MarkRead"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#">
Action open
<cfimap
action="open"
connection="openConnc"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#">
Action close
<cfimap action="close" connection="openConnc">
Action Delete
<cfimap
action="delete"
folder=""
messagenumber ="1"
server="#Imap.Server#"
port="#Imap.Port#"
username="#Imap.Username#"
password="#Imap.Password#"
secure="#Imap.Secure#">
See also
- Internet Protocols
- Sending Emails
- <cfmail>
- <cfpop>
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)