> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypersender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Rust SMS: Send Messages from Your Android Phone

> Send SMS from Laravel Rust through your own Android phone's SIM with the Hypersender package: send, schedule, retry, list and delete messages.

Hypersender sends SMS from the SIM in your own Android phone, through the Hypersender SMS app. Link the phone first, then set `HYPERSENDER_SMS_API_KEY` and `HYPERSENDER_SMS_INSTANCE_ID` as described in the [installation guide](https://docs.hypersender.com/v2/packages-and-sdks/laravel-rust/installation.md).

## Send a message

Inject `Sms` and call `send_message` with the number in E.164 format, the text, and a request ID of your own:

```rust theme={null}
use hypersender_laravel_rust::Sms;
use laravel::container::Inject;

pub async fn notify(sms: Inject<Sms>) -> laravel::Result<()> {
    sms.send_message("+20123456789", "Your order has shipped", "order-1042").await?;

    Ok(())
}
```

The request ID can be any string, such as a UUID or your order number. Use it to find the message later and to match it to its webhooks.

## Schedule, retry or expire

`send` takes the full request body, so you can use every option the [Send Message endpoint](https://docs.hypersender.com/v2/api-reference/sms/messages/send-message.md) has:

```rust theme={null}
use serde_json::json;

sms.send(json!({
    "to": "+20123456789",
    "content": "Your code is 4821",
    "request_id": "login-7",
    "message_expiration_seconds": 120,
    "max_send_attempts": 3,
}))
.await?;

sms.send(json!({
    "to": "+20123456789",
    "content": "Your appointment is tomorrow at 10:00",
    "request_id": "reminder-55",
    "schedule_send_at": "2026-12-10 09:00:00",
}))
.await?;
```

| Field | Meaning |
| - | - |
| `schedule_send_at` | Send later, for example `2026-12-10 09:00:00` |
| `max_send_attempts` | How many times to retry if sending fails, up to 15 |
| `message_expiration_seconds` | Give up after this many seconds. Useful for OTP codes |

## List and delete messages

```rust theme={null}
use serde_json::json;

let messages: serde_json::Value = sms.messages(json!({ "per_page": 20 })).await?.json()?;

sms.delete_message("9f8b7c6d-6666-4a2b-8c3d-4e5f6a7b8c9d").await?;
```

Filters for `messages` are in the [List Messages reference](https://docs.hypersender.com/v2/api-reference/sms/messages/index-messages.md).

## Delivery and incoming SMS

Delivery reports, incoming SMS and phone status arrive as webhooks. See [SMS webhooks](https://docs.hypersender.com/v2/packages-and-sdks/laravel-rust/sms/sms-webhooks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.