diff --git a/src/Fetch/Attachment.php b/src/Fetch/Attachment.php index 2919e20..892c8f0 100644 --- a/src/Fetch/Attachment.php +++ b/src/Fetch/Attachment.php @@ -134,7 +134,9 @@ class Attachment $this->setFileName($parameters['name']); } - $this->size = $structure->bytes; + if (property_exists($structure, 'bytes')) { + $this->size = $structure->bytes; + } $this->mimeType = Message::typeIdToString($structure->type); diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 34b6ee7..8374646 100644 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -764,7 +764,13 @@ class Message foreach ($addresses as $address) { if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') { $currentAddress = array(); - $currentAddress['address'] = $address->mailbox . '@' . $address->host; + + $host = ''; + if (property_exists($address, 'host')) { + $host = $address->host; + } + + $currentAddress['address'] = $address->mailbox . '@' . $host; if (isset($address->personal)) { $currentAddress['name'] = MIME::decode($address->personal, self::$charset); }