Skip to content

Commit 96f6ca6

Browse files
committed
Save an entire message (including its headers)
1 parent 95925da commit 96f6ca6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Message.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,4 +1544,14 @@ public function setSequenceId($uid, int $msglist = null): void {
15441544
$this->setMsgn($uid, $msglist);
15451545
}
15461546
}
1547+
1548+
/**
1549+
* Safe the entire message in a file
1550+
* @param $filename
1551+
*
1552+
* @return bool|int
1553+
*/
1554+
public function save($filename): bool|int {
1555+
return file_put_contents($filename, $this->header->raw."\r\n\r\n".$this->structure->raw);
1556+
}
15471557
}

0 commit comments

Comments
 (0)