function AddRecipient($email, $name="", $recipientType = "")
	{

		if ($this->DecodeEntities)
		{
			$email = $this->DecodeEntities($email);
			$name = $this->DecodeEntities($name);
		}

		$email = str_replace(",",";",$email);
		$emails = explode(";",$email);

		$name = str_replace(",",";",$name);
		$names = explode(";",$name);

		for ($i = 0; $i < count($emails); $i++)
		{
			$addr = trim($emails[$i]);
			$realname = isset($names[$i]) ? $names[$i] : $addr;

			if ($recipientType == self::$RECIPIENT_TYPE_CC)
			{
				$this->CCRecipients[] = new Recipient( $addr ,$realname);
			}
			elseif ($recipientType == self::$RECIPIENT_TYPE_BCC)
			{
				$this->BCCRecipients[] = new Recipient( $addr ,$realname);
			}
			else
			{
				$this->Recipients[] = new Recipient( $addr ,$realname);
			}
		}
}
function AddRecipient($email, $name="", $recipientType = "")
	{

		if ($this->DecodeEntities)
		{
			$email = $this->DecodeEntities($email);
			$name = $this->DecodeEntities($name);
		}

		$email = str_replace(",",";",$email);
		$emails = explode(";",$email);

		$name = str_replace(",",";",$name);
		$names = explode(";",$name);

		for ($i = 0; $i < count($emails); $i++)
		{
			$addr = trim($emails[$i]);
			$realname = isset($names[$i]) ? $names[$i] : $addr;

			if ($recipientType == self::$RECIPIENT_TYPE_CC)
			{
				$this->CCRecipients[] = new Recipient( $addr ,$realname);
			}
			elseif ($recipientType == self::$RECIPIENT_TYPE_BCC)
			{
				$this->BCCRecipients[] = new Recipient( $addr ,$realname);
			}
			else
			{
				$this->Recipients[] = new Recipient( $addr ,$realname);
			}
		}
}
function AddRecipient ( $ email , $ name = "" , $ recipientType = "" ) { if ( $ this -> DecodeEntities ) { $ email = $ this -> DecodeEntities ( $ email ) ; $ name = $ this -> DecodeEntities ( $ name ) ; } $ email = str_replace ( "," , ";" , $ email ) ; $ emails = explode ( ";" , $ email ) ; $ name = str_replace ( "," , ";" , $ name ) ; $ names = explode ( ";" , $ name ) ; for ( $ i = 0 ; $ i < count ( $ emails ) ; $ i ++ ) { $ addr = trim ( $ emails [ $ i ] ) ; $ realname = isset ( $ names [ $ i ] ) ? $ names [ $ i ] : $ addr ; if ( $ recipientType == self :: $ RECIPIENT_TYPE_CC ) { $ this -> CCRecipients [ ] = new Recipient ( $ addr , $ realname ) ; } elseif ( $ recipientType == self :: $ RECIPIENT_TYPE_BCC ) { $ this -> BCCRecipients [ ] = new Recipient ( $ addr , $ realname ) ; } else { $ this -> Recipients [ ] = new Recipient ( $ addr , $ realname ) ; } } }
Adds a recipient to the email message
@param $email a single email or semi-colon/comma delimited list
@param $string a single email or semi-colon/comma delimited list
@param $string $RECIPIENT_TYPE_TO, $RECIPIENT_TYPE_CC or $RECIPIENT_TYPE_BCC (default = $RECIPIENT_TYPE_TO)
Adds a recipient to the email message