(PHP 4, PHP 5, PHP 7, PHP 8)
imap_uid — Получает UID по номеру сообщения
Эта функция возвращает UID для сообщения с заданным номером. UID — это уникальный идентификатор, который не меняется по прошествии времени, тогда как номер сообщение в ящике может меняться при изменении содержания почтового ящика.
Эта функция обратная функции imap_msgno() .
UID заданного письма.
| Версия | Описание |
|---|---|
| 8.1.0 |
Параметр imap теперь принимает объект IMAP\Connection ;
раньше параметр ждал ресурс (resource ) imap.
|
Замечание:
Эта функция не поддерживается для почтовых ящиков POP3.
I would like to point out that, at least in the case of Gmail, the UIDs of emails are changed if they are moved from one folder to another. Even if moved back to the same folder the UIDs get incremented and thus changed.
I found this the hard way after relaying on the notion that UIDs do not change as I found almost everywhere in the docs.Be aware that the uid is unique in a single mailbox. That means a message can have as much uids as mailboxesPlease note that message_id in the header is NOT the UID - and its dangerous to use as many mail progs don't put a message id inThe uid will change in case of unsing imap_expunge. Be shure that
all work ist done before using imap_expunge.