PHPMailer\PHPMailer\PHPMailer::addOrEnqueueAnAddress PHP Method

addOrEnqueueAnAddress() protected method

Addresses that have been added already return false, but do not throw exceptions.
protected addOrEnqueueAnAddress ( string $kind, string $address, string $name ) : boolean
$kind string One of 'to', 'cc', 'bcc', or 'ReplyTo'
$address string The email address to send, resp. to reply to
$name string
return boolean true on success, false if address already used or invalid in some way
    protected function addOrEnqueueAnAddress($kind, $address, $name)
    {
        $address = trim($address);
        $name = trim(preg_replace('/[\\r\\n]+/', '', $name));
        //Strip breaks and trim
        if (($pos = strrpos($address, '@')) === false) {
            // At-sign is misssing.
            $error_message = $this->lang('invalid_address') . " (addAnAddress {$kind}): {$address}";
            $this->setError($error_message);
            $this->edebug($error_message);
            if ($this->exceptions) {
                throw new Exception($error_message);
            }
            return false;
        }
        $params = [$kind, $address, $name];
        // Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
        if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
            if ('Reply-To' != $kind) {
                if (!array_key_exists($address, $this->RecipientsQueue)) {
                    $this->RecipientsQueue[$address] = $params;
                    return true;
                }
            } else {
                if (!array_key_exists($address, $this->ReplyToQueue)) {
                    $this->ReplyToQueue[$address] = $params;
                    return true;
                }
            }
            return false;
        }
        // Immediately add standard addresses without IDN.
        return call_user_func_array([$this, 'addAnAddress'], $params);
    }