/** * @param string $type * * @return array */ protected function parseRecipients($type) { $all = $this->message->getRecipients(); $headers = $this->message->getHeaders(); $recipients = isset($headers[$type]) ? $headers[$type] : []; $result = []; foreach ($recipients as $key => $recipient) { if ($key === 'append') { continue; } if (in_array($recipient, $all)) { $result[] = trim($recipient); } } return $result; }