Skip to content

Commit 949826c

Browse files
authored
Merge pull request #134 from igor-khripun/patch-1
Clear Imap Errors
2 parents 0b2e430 + a11db0a commit 949826c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PhpImap/Mailbox.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ public function switchMailbox($imapPath = '') {
9797
protected function initImapStream() {
9898
$imapStream = @imap_open($this->imapPath, $this->imapLogin, $this->imapPassword, $this->imapOptions, $this->imapRetriesNum, $this->imapParams);
9999
if(!$imapStream) {
100-
throw new Exception('Connection error: ' . imap_last_error());
100+
$lastError = imap_last_error();
101+
imap_errors();
102+
throw new Exception('Connection error: ' . $lastError);
101103
}
102104
return $imapStream;
103105
}

0 commit comments

Comments
 (0)