Skip to content

Commit 3b8d650

Browse files
committed
Problem with Message::moveToFolder() and multiple moves #31
1 parent 1c981f8 commit 3b8d650

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/IMAP/Message.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,15 @@ public function getContainingFolder(Folder $folder = null) {
947947
/**
948948
* Move the Message into an other Folder
949949
* @param string $mailbox
950+
* @param bool $expunge
951+
* @param bool $create_folder
950952
*
951953
* @return bool
952954
* @throws Exceptions\ConnectionFailedException
953955
*/
954-
public function moveToFolder($mailbox = 'INBOX') {
955-
$this->client->createFolder($mailbox);
956+
public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) {
957+
958+
if($create_folder) $this->client->createFolder($mailbox, true);
956959

957960
return imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID);
958961
}

0 commit comments

Comments
 (0)