Basit Ali
Basit Ali

Reputation: 155

How to move emails to subfolders in coldfusion using <cfimap>

I am using the below code but its not working, no error coming but emails not moving to the recommended folder.

<cfimap action="MoveMail" Recurse="true" newfolder="MainFolder/SubFolder" messagenumber="1" stoponerror="true" connection="connection"> 

Upvotes: 2

Views: 198

Answers (1)

rrk
rrk

Reputation: 15846

This operation is not allowed on a closed folder

The error handling on cfimap is sometime very obscure. From my experience when I faced similar issue, the fix was to use the folder attribute to let the tag now from which folder we need to move the mail.

<cfimap
    action="MoveMail"
    Recurse="true"
    folder="SourceFolder"
    newfolder="MainFolder/SubFolder"
    messagenumber="1"
    stoponerror="true"
    connection="connection"
>

Upvotes: 3

Related Questions