private function AddAnAddress($kind, $address, $name = '') {
    if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
      echo 'Invalid recipient array: ' . kind;
      return false;
    }
    $address = trim($address);
    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
    if (!self::ValidateAddress($address)) {
      $this->SetError($this->Lang('invalid_address').': '. $address);
      if ($this->exceptions) {
        throw new phpmailerException($this->Lang('invalid_address').': '.$address);
      }
      echo $this->Lang('invalid_address').': '.$address;
      return false;
    }
    if ($kind != 'ReplyTo') {
      if (!isset($this->all_recipients[strtolower($address)])) {
        array_push($this->$kind, array($address, $name));
        $this->all_recipients[strtolower($address)] = true;
        return true;
      }
    } else {
      if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
        $this->ReplyTo[strtolower($address)] = array($address, $name);
      return true;
    }
  }
  return false;
}
private function AddAnAddress($kind, $address, $name = '') {
    if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
      echo 'Invalid recipient array: ' . kind;
      return false;
    }
    $address = trim($address);
    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
    if (!self::ValidateAddress($address)) {
      $this->SetError($this->Lang('invalid_address').': '. $address);
      if ($this->exceptions) {
        throw new phpmailerException($this->Lang('invalid_address').': '.$address);
      }
      echo $this->Lang('invalid_address').': '.$address;
      return false;
    }
    if ($kind != 'ReplyTo') {
      if (!isset($this->all_recipients[strtolower($address)])) {
        array_push($this->$kind, array($address, $name));
        $this->all_recipients[strtolower($address)] = true;
        return true;
      }
    } else {
      if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
        $this->ReplyTo[strtolower($address)] = array($address, $name);
      return true;
    }
  }
  return false;
}
private function AddAnAddress ( $ kind , $ address , $ name = '' ) { if ( ! preg_match ( '/^(to|cc|bcc|ReplyTo)$/' , $ kind ) ) { echo 'Invalid recipient array: ' . kind ; return false ; } $ address = trim ( $ address ) ; $ name = trim ( preg_replace ( '/[\r\n]+/' , '' , $ name ) ) ; //Strip breaks and trim if ( ! self :: ValidateAddress ( $ address ) ) { $ this -> SetError ( $ this -> Lang ( 'invalid_address' ) . ': ' . $ address ) ; if ( $ this -> exceptions ) { throw new phpmailerException ( $ this -> Lang ( 'invalid_address' ) . ': ' . $ address ) ; } echo $ this -> Lang ( 'invalid_address' ) . ': ' . $ address ; return false ; } if ( $ kind != 'ReplyTo' ) { if ( ! isset ( $ this -> all_recipients [ strtolower ( $ address ) ] ) ) { array_push ( $ this -> $ kind , array ( $ address , $ name ) ) ; $ this -> all_recipients [ strtolower ( $ address ) ] = true ; return true ; } } else { if ( ! array_key_exists ( strtolower ( $ address ) , $ this -> ReplyTo ) ) { $ this -> ReplyTo [ strtolower ( $ address ) ] = array ( $ address , $ name ) ; return true ; } } return false ; }
Adds an address to one of the recipient arrays
Addresses that have been added already return false, but do not throw exceptions
@param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
@param string $address The email address to send to
@param string $name
@return boolean true on success, false if address already used or invalid in some way
@access private
Adds an address to one of the recipient arrays Addresses that have been added already return false but do not throw exceptions