Skip to main content

Crate jetemail

Crate jetemail 

Source
Expand description

§JetEmail Rust SDK

Official Rust SDK for the JetEmail email API.

§Quick Start

let client = jetemail::JetEmail::new("je_your_api_key");

let email = jetemail::CreateEmailOptions::new(
    "you@example.com",
    "recipient@example.com",
    "Hello from JetEmail!",
)
.with_html("<h1>Hello!</h1>");

let response = client.emails.send(email).await?;
println!("Sent email: {}", response.id);

§Blocking Usage

Enable the blocking feature in your Cargo.toml:

[dependencies]
jetemail = { version = "0.1", features = ["blocking"] }

Then use the same API synchronously:

let client = jetemail::JetEmail::new("je_your_api_key");
let response = client.emails.send(email)?;

Structs§

Attachment
An email attachment.
BatchEmailResponse
Response from sending a batch of emails.
BatchSvc
Service for sending batch emails via the JetEmail API.
Config
Configuration for the JetEmail API client.
ConfigBuilder
Builder for constructing a Config.
CreateEmailOptions
Options for creating and sending an email.
CreateEmailResponse
Response from sending an email.
EmailsSvc
Service for sending individual emails via the JetEmail API.
ErrorResponse
Error response returned by the JetEmail API.
JetEmail
The JetEmail API client.

Enums§

Error
Top-level error type for the JetEmail SDK.

Traits§

IntoEmailRecipients
Trait for types that can be converted into a list of email recipients.

Type Aliases§

Result
Convenience result type for the JetEmail SDK.