Skip to content

Commit

Permalink
Add method to fetch raw email message
Browse files Browse the repository at this point in the history
Sometimes you want to use another mail parser and you need raw message.
  • Loading branch information
tomhorvat committed Oct 16, 2015
1 parent 815e8af commit ee185ab
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 @@ -396,6 +396,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 ee185ab

Please sign in to comment.