diff --git a/PlancakeEmailParser.php b/PlancakeEmailParser.php index 59e6cee..7958e04 100644 --- a/PlancakeEmailParser.php +++ b/PlancakeEmailParser.php @@ -203,7 +203,7 @@ public function getBody($returnType=self::PLAINTEXT) $contentTypeRegex = '/^Content-Type: ?text\/plain/i'; // there could be more than one boundary - preg_match_all('!boundary=(.*)$!mi', $this->emailRawContent, $matches); + preg_match_all('!boundary=(.*?)[;$]!mi', $this->emailRawContent, $matches); $boundaries = $matches[1]; // sometimes boundaries are delimited by quotes - we want to remove them foreach($boundaries as $i => $v) {