Skip to main content

Crate smbcloud_email_sdk

Crate smbcloud_email_sdk 

Source
Expand description

Rust client for the smbCloud transactional email API.

Send transactional email from your verified domain and read each message’s delivery status. This crate handles the HTTP transport and the Authorization: Bearer <api_key> header; you build the message and own the content.

§Quick start

use smbcloud_email_sdk::{EmailClient, EmailCredentials, Environment, SendEmail};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = EmailClient::from_credentials(
        Environment::Production,
        EmailCredentials { api_key: "smb_mail_your_key" },
    );

    let message = SendEmail::new("billing@example.com", ["customer@acme.com"])
        .subject("Your receipt")
        .html("<h1>Thanks!</h1>")
        .text("Thanks!")
        .idempotency_key("receipt-2026-0001");

    let sent = client.send(&message).await?;
    println!("sent {} ({:?})", sent.id, sent.status);

    Ok(())
}

Structs§

Attachment
One attachment on an outbound email. content_base64 is the file content encoded as standard base64; the server reassembles it into the MIME message.
EmailClient
Talks to the smbCloud transactional email API.
EmailCredentials
API credential for the smbCloud transactional email API.
EmailEvent
One delivery event in a message’s timeline (delivered, bounced, opened, …). Present on EmailMessage only when fetched via crate::EmailClient::get_message.
EmailMessage
A transactional email as returned by the API: the send result and, when fetched by id, its delivery status and event timeline.
SendEmail
An outbound transactional email.

Enums§

EmailError
EmailStatus
Delivery status of a transactional email, mirroring the server-side integer-backed enum. Deserialized with serde_repr from the plain integer the API returns.
Environment

Functions§

base_url
Resolve the email API base URL for the given environment.