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

# Send emails with Rust

> Send a transactional email with the official Apollo Signal Rust SDK

The Rust SDK provides an async class-based client and uses
`https://api.signal.apollodeploy.com` by default.

Before you start, [create an API key](/signal/create-an-api-key) with **Emails: Send** permission
and [verify the From domain](/signal/add-a-domain).

<Steps>
  <Step title="Install the SDK">
    ```bash theme={"dark"}
    cargo add apollo-signal-sdk
    ```
  </Step>

  <Step title="Store your API key">
    Set `SIGNAL_API_KEY` in the server environment or secret manager.
  </Step>

  <Step title="Send an email">
    ```rust theme={"dark"}
    use apollo_signal_sdk::{Client, ClientConfig};
    use apollo_signal_sdk::types::SendEmailRequest;

    #[tokio::main]
    async fn main() -> Result<(), Box<dyn std::error::Error>> {
        let mut config = ClientConfig::default();
        config.default_headers.insert(
            "Authorization".into(),
            format!("Bearer {}", std::env::var("SIGNAL_API_KEY")?),
        );
        let signal = Client::new(config);

        let email = signal.emails.send_email(&SendEmailRequest {
            from: "auth@mail.company.com".into(),
            to: vec!["alex@example.com".into()],
            subject: Some("Reset your password".into()),
            text: Some(
                "Use the secure link in your account to choose a new password.".into(),
            ),
            cc: None,
            bcc: None,
            reply_to: None,
            html: None,
            tags: None,
            metadata: None,
            idempotency_key: None,
            test_mode: None,
            attachments: None,
            scheduled_at: None,
            delivery_window: None,
            send_time_category: None,
            tracking_settings: None,
        }).await?;

        println!("{}", email.id);
        Ok(())
    }
    ```
  </Step>
</Steps>

<Note>
  The generated request type keeps optional fields explicit. Add an `idempotency_key` when a worker
  may retry the same logical send.
</Note>

<CardGroup cols={2}>
  <Card title="All SDKs" icon="code" href="/signal/send-with/sdk-overview">
    Compare every supported language and framework.
  </Card>

  <Card title="Manage emails" icon="envelope" href="/signal/dashboard/emails/introduction">
    Follow message states and delivery timelines.
  </Card>
</CardGroup>
