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_base64is the file content encoded as standard base64; the server reassembles it into the MIME message. - Email
Client - Talks to the smbCloud transactional email API.
- Email
Credentials - API credential for the smbCloud transactional email API.
- Email
Event - One delivery event in a message’s timeline (delivered, bounced, opened, …).
Present on
EmailMessageonly when fetched viacrate::EmailClient::get_message. - Email
Message - A transactional email as returned by the API: the send result and, when fetched by id, its delivery status and event timeline.
- Send
Email - An outbound transactional email.
Enums§
- Email
Error - Email
Status - Delivery status of a transactional email, mirroring the server-side
integer-backed enum. Deserialized with
serde_reprfrom the plain integer the API returns. - Environment
Functions§
- base_
url - Resolve the email API base URL for the given environment.