> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/ui-and-interaction/phone.md).

# Phone

## Phone

Look up phone numbers and send in-game mail through supported phone resources.

### Supported resources

* `lb-phone`
* `qb-phone`
* `okokPhone`
* `qs-smartphone-pro`
* `gksphone`
* `cylex_phone`

### Functions

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>GetNumber</strong></td><td>Returns players phone number using active phone resource. Fallbacks to framework function.</td><td><a href="#getnumber">#getnumber</a></td></tr><tr><td><strong>GetResource</strong></td><td>Returns phone resource name.</td><td><a href="#getresource">#getresource</a></td></tr><tr><td><strong>SendMail</strong></td><td>Send mail to player. Recommend to use `server` side function.</td><td><a href="#sendmail">#sendmail</a></td></tr><tr><td><strong>SetResource</strong></td><td>Force set phone resource.</td><td><a href="#setresource">#setresource</a></td></tr></tbody></table>

***

## GetNumber

Returns players phone number using active phone resource. Fallbacks to framework function.

{% hint style="info" %}
**Side:** Server · **Category:** Phone · **API:** `LT.Phone.GetNumber`
{% endhint %}

### Example

```lua
local result = LT.Phone.GetNumber(source)
```

### Parameters

| Name     | Required | Description   |
| -------- | -------- | ------------- |
| `source` | Yes      | Player source |

### Returns

* `string|nil` Phone number`if found,`nil `otherwise.`

***

## GetResource

Returns phone resource name.

{% hint style="info" %}
**Side:** Shared · **Category:** Phone · **API:** `LT.Phone.GetResource`
{% endhint %}

### Example

```lua
local result = LT.Phone.GetResource()
```

### Returns

* `'lb-phone'|'qb-phone'|'okokPhone'|'qs-smartphone-pro'|'gksphone'|'cylex_phone'|nil`

***

## SendMail

Send mail to a player. Use the **server** function when you need a reliable delivery result.

{% hint style="info" %}
**Side:** Client / Server · **Category:** Phone · **API:** `LT.Phone.SendMail`
{% endhint %}

### Example

```lua
-- Client (fires server event; always returns true)
LT.Phone.SendMail('sender@mail.com', 'Title', 'Hello!')

-- Server
local success = LT.Phone.SendMail(source, 'sender@mail.com', 'Title', 'Hello!')
```

### Parameters

| Name      | Required    | Description      |
| --------- | ----------- | ---------------- |
| `source`  | Server only | Player server ID |
| `mail`    | Yes         | Sender address   |
| `title`   | Yes         | Mail title       |
| `message` | Yes         | Mail body        |

### Returns

* `boolean` — client return is optimistic; check server return for actual result

***

## SetResource

Force set phone resource.

{% hint style="info" %}
**Side:** Shared · **Category:** Phone · **API:** `LT.Phone.SetResource`
{% endhint %}

### Example

```lua
LT.Phone.SetResource('lb-phone')
```

### Parameters

| Name   | Required | Description |
| ------ | -------- | ----------- |
| `name` | Yes      | 'lb-phone'  |
