Skip to content

Commit 691f8e0

Browse files
committed
Merge pull request #27 from ArabCoders/master
fixed bug in getting reply_to addresses
2 parents 938f8cf + 0fc6487 commit 691f8e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Fetch/Message.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ public function getMessageBody($html = false)
311311
}
312312
} else {
313313
if (!isset($this->plaintextMessage) && isset($this->htmlMessage)) {
314-
$output = strip_tags($this->htmlMessage);
314+
$output = preg_replace('/\<br(\s*)?\/?\>/i', PHP_EOL, trim($this->htmlMessage) );
315+
$output = strip_tags($output);
315316

316317
return $output;
317318
} elseif (isset($this->plaintextMessage)) {
@@ -332,7 +333,8 @@ public function getMessageBody($html = false)
332333
*/
333334
public function getAddresses($type, $asString = false)
334335
{
335-
$addressTypes = array('to', 'cc', 'bcc', 'from', 'reply-to');
336+
$type = ( $type == 'reply-to' ) ? 'replyTo' : $type;
337+
$addressTypes = array('to', 'cc', 'bcc', 'from', 'replyTo');
336338

337339
if (!in_array($type, $addressTypes) || !isset($this->$type) || count($this->$type) < 1)
338340
return false;

0 commit comments

Comments
 (0)