From a1632d25fc46d130357c23c2304b5b73be8894f1 Mon Sep 17 00:00:00 2001 From: Charly Root Date: Tue, 8 Oct 2013 00:00:53 +0200 Subject: allow posting by unknown email addresses --- src/EmailMessage.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/EmailMessage.php') diff --git a/src/EmailMessage.php b/src/EmailMessage.php index 6c025ab..dd25045 100644 --- a/src/EmailMessage.php +++ b/src/EmailMessage.php @@ -68,6 +68,16 @@ abstract class EmailMessage implements Message { return $from[0]['address']; } + public function getFromDisplayName() { + $from = mailparse_rfc822_parse_addresses($this->getHeader('from')); + if ($from[0]['address'] != $from[0]['display']) { + return $from[0]['display']; + } + else { + return ''; + } + } + public function getSubject() { return $this->getHeader('subject'); } -- cgit v1.2.3