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

# Rust

> Send emails from Rust using the SendKit SDK.

<CardGroup cols={2}>
  <Card title="Source Code" icon="github" href="https://github.com/sendkitdev/sendkit-rust">
    View on GitHub
  </Card>

  <Card title="Package" icon="box" href="https://crates.io/crates/sendkit">
    View on crates.io
  </Card>
</CardGroup>

## Install

Add to your `Cargo.toml`:

```toml theme={null}
[dependencies]
sendkit = "1"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
```

## Send email

```rust theme={null}
use sendkit::{SendKit, SendEmailParams};

#[tokio::main]
async fn main() {
    let client = SendKit::new("sk_your_api_key").unwrap();

    let response = client.emails.send(&client, &SendEmailParams {
        from: "Your Name <you@yourdomain.com>".into(),
        to: vec!["recipient@example.com".into()],
        subject: "Hello from SendKit".into(),
        html: Some("<h1>Welcome!</h1><p>Your first email with SendKit.</p>".into()),
        ..Default::default()
    }).await.unwrap();

    println!("Email sent: {}", response.id);
}
```
