src/ShvetsGroup/LaravelEmailDatabaseLog/EmailLogger.php
function formatAddressField($message, $field)
    {
        $headers = $message->getHeaders();

        if (!$headers->has($field)) {
            return null;
        }

        $mailboxes = $headers->get($field)->getFieldBodyModel();

        $strings = [];
        foreach ($mailboxes as $email => $name) {
            $mailboxStr = $email;
            if (null !== $name) {
                $mailboxStr = $name . ' <' . $mailboxStr . '>';
            }
            $strings[] = $mailboxStr;
        }
        return implode(', ', $strings);
    }
function formatAddressField($message, $field)
    {
        $headers = $message->getHeaders();

        if (!$headers->has($field)) {
            return null;
        }

        $mailboxes = $headers->get($field)->getFieldBodyModel();

        $strings = [];
        foreach ($mailboxes as $email => $name) {
            $mailboxStr = $email;
            if (null !== $name) {
                $mailboxStr = $name . ' <' . $mailboxStr . '>';
            }
            $strings[] = $mailboxStr;
        }
        return implode(', ', $strings);
    }
function formatAddressField ( $ message , $ field ) { $ headers = $ message -> getHeaders ( ) ; if ( ! $ headers -> has ( $ field ) ) { return null ; } $ mailboxes = $ headers -> get ( $ field ) -> getFieldBodyModel ( ) ; $ strings = [ ] ; foreach ( $ mailboxes as $ email => $ name ) { $ mailboxStr = $ email ; if ( null !== $ name ) { $ mailboxStr = $ name . ' <' . $ mailboxStr . '>' ; } $ strings [ ] = $ mailboxStr ; } return implode ( ', ' , $ strings ) ; }
Format address strings for sender, to, cc, bcc.

@param $message
@param $field
@return null|string
Format address strings for sender to cc bcc .