imap_close

Close an IMAP stream

&reftitle.description; `true` `imap_close` `IMAP\Connection` `imap` `int` `flags` 0

Closes the imap stream.

&reftitle.parameters;

&imap.imap-parameter.imap;

`flags`

- If set to `CL_EXPUNGE`, the function will silently expunge the mailbox before closing, removing all messages marked for deletion. You can achieve the same thing by using `imap_expunge`

&reftitle.returnvalues;

&return.true.always;

&reftitle.errors;

Throws a `ValueError` if `flags` is invalid.

&reftitle.changelog;

&Version; | &Description;
&imap.changelog.imap-param;
8.0.0 | A `ValueError` is now thrown on invalid `flags` parameter values. Previously, a warning was emitted and the function returned &false;.

&reftitle.seealso;

- `imap_open`