Skip to content

Commit

Permalink
Don't set the charset if it isn't used - prevent strange outlook mail…
Browse files Browse the repository at this point in the history
… server errors #100
  • Loading branch information
Webklex committed Jul 22, 2018
1 parent 4fd65cf commit f22d863
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/IMAP/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@ public function get() {

try {
$this->generate_query();
$available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), SE_UID, $this->getCharset());

/**
* Don't set the charset if it isn't used - prevent strange outlook mail server errors
* @see https://github.com/Webklex/laravel-imap/issues/100
*/
if($this->getCharset() === null){
$available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), SE_UID);
}else{
$available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), SE_UID, $this->getCharset());
}

if ($available_messages !== false) {

Expand Down

0 comments on commit f22d863

Please sign in to comment.