Skip to content

Commit 70e2bab

Browse files
committed
Merge pull request #96 from tomhorvat/patch-1
Add method to fetch raw email message
2 parents 171a704 + ee185ab commit 70e2bab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/PhpImap/Mailbox.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,22 @@ public function getQuotaUsage() {
417417
}
418418
return $quota;
419419
}
420+
421+
/**
422+
* Get raw mail data
423+
*
424+
* @param $msgId
425+
* @param bool $markAsSeen
426+
* @return mixed
427+
*/
428+
public function getRawMail($msgId, $markAsSeen = true){
429+
$options = FT_UID;
430+
if(!$markAsSeen) {
431+
$options |= FT_PEEK;
432+
}
433+
434+
return imap_fetchbody($this->getImapStream(), $msgId, '', $options);
435+
}
420436

421437
/**
422438
* Get mail data

0 commit comments

Comments
 (0)