We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 179b7aa commit c760ebeCopy full SHA for c760ebe
src/IMAP/Client.php
@@ -95,6 +95,13 @@ public function __construct($config = []) {
95
$this->setConfig($config);
96
}
97
98
+ /**
99
+ * Client destructor
100
+ */
101
+ public function __destruct() {
102
+ $this->disconnect();
103
+ }
104
+
105
/**
106
* Set the Client configuration
107
*
@@ -201,6 +208,7 @@ public function connect($attempts = 3) {
201
208
*/
202
209
public function disconnect() {
203
210
if ($this->isConnected()) {
211
+ $this->expunge();
204
212
imap_close($this->connection);
205
213
206
214
@@ -419,5 +427,4 @@ public function expunge(){
419
427
public function checkCurrentMailbox(){
420
428
return imap_check($this->connection);
421
429
422
-
423
430
0 commit comments