$res = CSocNetMessages::GetList( Array("SORT"=>"ASC", "PROPERTY_PRIORITY"=>"ASC"), Array("TO_USER_ID" => $USER, "MESSAGE_TYPE" => "P") ); while($ar_fields = $res->GetNext()) { echo "Юзер ИД ".$ar_fields["FROM_USER_ID"]."<br />"; }