Also handles moves to the tasklist and/or notepad applications.
public copy ( string $targetMbox, string $action, array $opts = [] ) : boolean | ||
$targetMbox | string | The mailbox to move/copy messages to (UTF-8). |
$action | string | Either 'copy' or 'move'. |
$opts | array | Additional options:
- create: (boolean) Should the target mailbox be created? DEFAULT: false |
return | boolean | True if successful, false if not. |
/** * Moves messages to a mailbox. * * @param string $mailbox The name of the source mailbox (UTF-8). * @param array $indices The list of UIDs to move. * @param string $target The name of the target mailbox (UTF-8). * * @return boolean True if successful, false if not. */ public function moveMessages($mailbox, $indices, $target) { $i = new IMP_Indices($mailbox, $indices); return $i->copy($target, 'move', array('create' => true)); }