PHP 8.3.4 Released!

imap_undelete

(PHP 4, PHP 5, PHP 7, PHP 8)

imap_undelete削除マークがついているメッセージのマークをはずす

説明

imap_undelete(IMAP\Connection $imap, string $message_nums, int $flags = 0): true

指定したメッセージについて、 imap_delete() または imap_mail_move() で設定された削除フラグをはずします。

パラメータ

imap

IMAP\Connection クラスのインスタンス。

message_nums

IMAP4 形式のシーケンスフォーマット ("n", "n:m", またはそれらをカンマで区切ったもの) で表現された、ひとつ以上のメッセージを表す文字列。

flags

戻り値

常に true を返します。

変更履歴

バージョン 説明
8.1.0 引数 imap は、IMAP\Connection クラスのインスタンスを期待するようになりました。 これより前のバージョンでは、有効な imap リソース が期待されていました。

参考

  • imap_delete() - 現在のメールボックスから削除するメッセージに印を付ける
  • imap_mail_move() - 指定されたメッセージをメールボックスに移動する

add a note

User Contributed Notes 2 notes

up
0
phrank
16 years ago
If you need to use the uid instead of msgno use

imap_clearflag_full($stream, implode(',', $flags), '\\DELETED', ST_UID);
up
0
rdi at nospam dot donireland dot com
16 years ago
The imap_delete function allows the option to use a UID for the message number but the imap_undelete function does not.
To Top