fixes undefined property

This commit is contained in:
Akolzin Dmitry 2024-02-08 12:08:07 +03:00
parent 2f87688e3d
commit bcaa835898
2 changed files with 10 additions and 2 deletions

View File

@ -134,7 +134,9 @@ class Attachment
$this->setFileName($parameters['name']);
}
if (property_exists($structure, 'bytes')) {
$this->size = $structure->bytes;
}
$this->mimeType = Message::typeIdToString($structure->type);

View File

@ -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);
}