Skip to content

Undefined property: stdClass::$host #95

@gpilla

Description

@gpilla

Undefined property: stdClass::$host

... /vendor/tedivm/fetch/src/Fetch/Message.php:573

It can be reproduced when the To header is not an email.

Example:
To: undisclosed-recipients:;

It happened when i received a email from a Redmine app.

I fast fixed adding this:

$currentAddress['address'] = $address->mailbox . '@' . $address->host;
if (isset($address->personal))
    $currentAddress['name'] = $address->personal;
$outputAddresses[] = $currentAddress;

Changing with this...

if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') {
     $currentAddress['address'] = $address->mailbox . '@' . $address->host;
     if (isset($address->personal))
        $currentAddress['name'] = $address->personal;
        $outputAddresses[] = $currentAddress;
}

I know that is a fast and quite dirty solution.

Sorry for my english.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions