Skip to content

Commit

Permalink
Merge pull request #96 from tomhorvat/patch-1
Browse files Browse the repository at this point in the history
Add method to fetch raw email message
  • Loading branch information
barbushin committed Dec 11, 2015
2 parents 171a704 + ee185ab commit 70e2bab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/PhpImap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,22 @@ public function getQuotaUsage() {
}
return $quota;
}

/**
* Get raw mail data
*
* @param $msgId
* @param bool $markAsSeen
* @return mixed
*/
public function getRawMail($msgId, $markAsSeen = true){
$options = FT_UID;
if(!$markAsSeen) {
$options |= FT_PEEK;
}

return imap_fetchbody($this->getImapStream(), $msgId, '', $options);
}

/**
* Get mail data
Expand Down

0 comments on commit 70e2bab

Please sign in to comment.