Skip to content

Commit 171a704

Browse files
committed
Merge pull request barbushin#114 from goosehub/patch-1
Copy Mail function
2 parents bc9fb09 + b893acf commit 171a704

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/PhpImap/Mailbox.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,21 @@ public function deleteMail($mailId) {
200200
return imap_delete($this->getImapStream(), $mailId, FT_UID);
201201
}
202202

203+
/**
204+
* Moves mails listed in mailId into new mailbox
205+
* @return bool
206+
*/
203207
public function moveMail($mailId, $mailBox) {
204208
return imap_mail_move($this->getImapStream(), $mailId, $mailBox, CP_UID) && $this->expungeDeletedMails();
205209
}
210+
211+
/**
212+
* Copys mails listed in mailId into new mailbox
213+
* @return bool
214+
*/
215+
public function copyMail($mailId, $mailBox) {
216+
return imap_mail_copy($this->getImapStream(), $mailId, $mailBox, CP_UID) && $this->expungeDeletedMails();
217+
}
206218

207219
/**
208220
* Deletes all the mails marked for deletion by imap_delete(), imap_mail_move(), or imap_setflag_full().

0 commit comments

Comments
 (0)