src/Mail/Mail.php
public function to($email, $name = null) {

		if(false === $this -> validateEmail($email)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be a valid email', __METHOD__), E_USER_ERROR);
		}

		if(null !== $name && false === is_string($name)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
		}

		if(false === isset($this -> headers['to'])) {
			$this -> headers['to'] = [];
		}

		$this -> headers['to'][] = (object) ['email' => $email, 'name' => $name];

		return $this;	
	}
public function to($email, $name = null) {

		if(false === $this -> validateEmail($email)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be a valid email', __METHOD__), E_USER_ERROR);
		}

		if(null !== $name && false === is_string($name)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
		}

		if(false === isset($this -> headers['to'])) {
			$this -> headers['to'] = [];
		}

		$this -> headers['to'][] = (object) ['email' => $email, 'name' => $name];

		return $this;	
	}
public function to ( $ email , $ name = null ) { if ( false === $ this -> validateEmail ( $ email ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be a valid email' , __METHOD__ ) , E_USER_ERROR ) ; } if ( null !== $ name && false === is_string ( $ name ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ name ) ) , E_USER_ERROR ) ; } if ( false === isset ( $ this -> headers [ 'to' ] ) ) { $ this -> headers [ 'to' ] = [ ] ; } $ this -> headers [ 'to' ] [ ] = ( object ) [ 'email' => $ email , 'name' => $ name ] ; return $ this ; }
Adds to email
@param string $email
@param string $name
@return sFire\Mail\Mail
Adds to email