Add a single BCC address with optional name

@param string $email The email address e.g. john@example.com
@param string $name The name for the address e.g. John Doe
@return \luya\components\Mail
496411
public function bccAddress($email, $name = null)
    {
        $this->getMailer()->addBCC($email, (empty($name)) ? $email : $name);

        return $this;
    }
319368
public function to(string $email, string $name = null)
    {
        $this->to[] = [
          'email' => $email,
          'name' => $name
        ];

        return $this;
    }
78300
protected function _formatAddress($email, $name)
    {
        if ($name === '' || $name === null || $name === $email) {
            return $email;
        } else {
            $encodedName = $this->_encodeHeader($name);
            if ($encodedName === $name  &&  strcspn($name, '()<>[]:;@\\,') != strlen($name)) {
                $format = '"%s" <%s>';
            } else {
                $format = '%s <%s>';
            }
            return sprintf($format, $encodedName, $email);
        }
    }
802335
public function addBcc(string $address, ?string $name = null): Message
    {
        $this->bcc[] = [
            'address' => $address,
            'name'    => $name
        ];

        return $this;
    }
1320490
protected function _addAddress($email, $name, $type) {

        $type = '_'.$type;

        $allowed = array(
            '_sender',
            '_from',
            '_to',
            '_cc',
            '_bcc',
            '_reply_to'
        );

        if (in_array($type, $allowed)) {
            if ($name != '') {
                $this->{$type}[$email] = $name;
            } else {
                $this->{$type}[] = $email;
            }
        }
    }
957200
public function addBcc($email)
    {
        if (!is_array($email)) {
            $email = array($email);
        }

        foreach ($email as $recipient) {
            $this->_addRecipientAndHeader('Bcc', $recipient, '');
        }

        return $this;
    }
1249373
public function addCc($email, $name='')
    {
        if (!is_array($email)) {
            $email = array($name => $email);
        }

        foreach ($email as $n => $recipient) {
            $this->_addRecipientAndHeader('Cc', $recipient, is_int($n) ? '' : $n);
        }

        return $this;
    }
1012081
public function addTo($email, $name = '', $type = 'to')
    {
        $this->to[] = array('email' => $email, 'name' => $name, 'type' => $type);

        return $this;
    }
740178
public function bcc($email = null, $name = null)
    {
        deprecationWarning('Email::bcc() is deprecated. Use Email::setBcc() or Email::getBcc() instead.');

        if ($email === null) {
            return $this->getBcc();
        }

        return $this->setBcc($email, $name);
    }
1086264
protected function addAddress($type, $email, $name = null)
    {
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            throw new \Parable\Mail\Exception("Email provided is invalid: {$email}");
        }
        $this->addresses[$type][] = [
            'email' => $email,
            'name'  => $name,
        ];
        return $this;
    }
473613
protected function getAddressValue(string $email, string $name = null)
    {
        if ($name === null || $name == '') {
            return $email;
        } else {
            return "{$name} <{$email}>";
        }
    }
1358509
public function setFrom(string $email, string $name = null): self
	{
		$this->message->setFrom($email, $name);
		return $this;
	}
493194
function addBcc( $email, $name = false )
    {
        $this->Mail->addBcc( new ezcMailAddress( $email, $name, $this->usedCharset() ) );
        $this->BccElements[] = array( 'name' => $name,
                                      'email' => $email );
    }
839998
public function addTo($email, $name = null)
    {
        $this->to = array_merge($this->to, $this->transformEmailName($email, $name));

        return $this;
    }
504964
public function setTo($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for setTo!');
        }

        if (empty($name)) {
            $name = substr($email, 0, strrpos($email, '@'));
        }

        if (is_null($this->to)) {
            $this->to = [$email, $name];
        } else {
            throw new MailerException('A master recipient has already been set!');
        }

        return $this;
    }
9568
public function cc( $email, $name = null ) 
	{	
		if ( !is_array( $email ) ) 
		{
			$email = array( $email => $name );
		}
		
		foreach( $email as $address => $name )
		{
			if ( is_numeric( $address ) && is_string( $name ) )
			{
				$this->cc[$name] = null;
			}
			else
			{
				$this->cc[$address] = $name;
			}
		}
		
		return $this;
	}
610675
public function subscribe(string $email, string $name = '')
    {
        $userList = $this->filter(new IsUserEmail($email))->limit(1)->all();

        $user = $userList[0] ?? new User([
                'email'        => $email,
                'name'         => $name,
                'guid'         => Guid::Generate(),
                'isSubscriber' => 1,
            ]);

        if ((new IsUserSubscriber())->isSatisfiedBy($user)) {
            return null;
        }

        if ($user->id) {
            return $this->update($user->id, ['isSubscriber' => 1]);

        }

        return $this->create($user);
    }