Core/Mailer/AbstractMail.php
public function addRecipients(string $type, array $recipients)
    {
        $types = [
            'to',
            'cc',
            'bcc'
        ];

        if (! in_array($type, $types)) {
            Throw new MailException(sprintf('The recipienttype "%" is not allowed. Please select from "to", "cc" or "bcc"'), $type);
        }

        foreach ($recipients as $key => $val) {
            if (is_numeric($key)) {
                $this->addRecipient($type, $val);
            } else {
                $this->addRecipient($type, $key, $val);
            }
        }
    }
public function addRecipients(string $type, array $recipients)
    {
        $types = [
            'to',
            'cc',
            'bcc'
        ];

        if (! in_array($type, $types)) {
            Throw new MailException(sprintf('The recipienttype "%" is not allowed. Please select from "to", "cc" or "bcc"'), $type);
        }

        foreach ($recipients as $key => $val) {
            if (is_numeric($key)) {
                $this->addRecipient($type, $val);
            } else {
                $this->addRecipient($type, $key, $val);
            }
        }
    }
Adds a list of recipients to the recipientslist

@param string $type
Name of the list to add the recipients. Can be "to", "cc" or "bcc".
@param array $recipients
List of recipients to add. This array can be an indexed array with only
the recipients mailaddress or an assoc array with mailaddress as key and
the recipients name as value.

@throws MailException when no valid type should be used