imap_reopen

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

imap_reopen新規メールボックスへの IMAP ストリームを再度オープンする

説明

imap_reopen(
    resource $imap,
    string $mailbox,
    int $flags = 0,
    int $retries = 0
): bool

IMAP または NNTP サーバー上の新しい mailbox に対して指定されたストリームを再オープンします。

パラメータ

imap

imap_open() が返す IMAP ストリーム。

mailbox

メールボックス名。詳細は imap_open() を参照ください。

警告

信頼できないデータをこのパラメータに渡すのであれば、 imap.enable_insecure_rsh を無効にしておかなければ危険です。

flags

flags はビットマスクであり、以下の組み合わせとなります。

  • OP_READONLY - メールボックスを読み込み専用でオープンします。
  • OP_ANONYMOUS - ニュースに関して .newsrc を使用せず、更新もしません(NNTP のみ)。
  • OP_HALFOPEN - IMAP および NNTP 名について、接続をオープンするがメールボックスをオープンしません。
  • OP_EXPUNGE - 何も警告せずにリサイクルストリームを削除します。
  • CL_EXPUNGE - メールボックスを閉じた際に、自動的に メールボックスを削除する(imap_delete() および imap_expunge() も参照ください)。

retries

接続試行の最大数。

返り値

ストリームを再度オープンした場合に true、 それ以外の場合に false を返します。

例1 imap_reopen() の例

<?php
$mbox 
imap_open("{imap.example.org:143}INBOX""username""password") or die(implode(", "imap_errors()));
// ...
imap_reopen($mbox"{imap.example.org:143}INBOX.Sent") or die(implode(", "imap_errors()));
// ..
?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top