Search code examples
emailzend-frameworkzend-framework2copyimap

zend imap not copying mail to different folder


When I try to copy an email to a different folder nothing happens. When I try to move the email it gets deleted but not moved, so the email does get found. I don't get any error messages either.

Relevant Code:

$unique_id = $mail->getUniqueId($messageNum);

var_dump($mail->copyMessage($mail->getNumberByUniqueId($unique_id), 'backup'));

The var_dump returns NULL.


Solution

  • Try to output the list of folders, to make sure backup folder exists.

    I may be prefixed with something else or wrapped with some symbols. so something like:

    foreach ( $mail->getFolders() as $localName => $folder)