25 releases (2 stable)

Uses new Rust 2024

2.0.0 May 1, 2026
1.0.0 Mar 25, 2026
0.11.5 Mar 21, 2026
0.11.4 Aug 7, 2025
0.3.0 Jul 31, 2021

#39 in Email

Download history 1820/week @ 2026-01-23 1210/week @ 2026-01-30 608/week @ 2026-02-06 469/week @ 2026-02-13 540/week @ 2026-02-20 761/week @ 2026-02-27 1119/week @ 2026-03-06 591/week @ 2026-03-13 713/week @ 2026-03-20 1006/week @ 2026-03-27 1000/week @ 2026-04-03 880/week @ 2026-04-10 523/week @ 2026-04-17 915/week @ 2026-04-24 607/week @ 2026-05-01 1079/week @ 2026-05-08

3,174 downloads per month
Used in polymail

MIT/Apache

315KB
8K SLoC

Postmark

ci crates.io Documentation License

A rust library to query Postmark API.

Usage

Add the crate dependency to your Cargo.toml:

[dependencies]
postmark = "x.y.z"

And use it, see documentation at: https://docs.rs/postmark.

use postmark::api::email::SendEmailRequest;
use postmark::api::Body;
use postmark::reqwest::PostmarkClient;
use postmark::Query;

async fn send_email(){
  let client = PostmarkClient::builder()
   .server_token("<sometoken>")
   .build();

  let req = SendEmailRequest::builder()
    .from("me@example.com")
    .to("you@example.com")
    .body(Body::text("it's me, Mario!".to_string()))
    .build();
  let resp = req.execute(&client).await;
}

Messages example:

use postmark::api::messages::OutboundSearchRequest;
use postmark::reqwest::PostmarkClient;
use postmark::Query;

async fn list_messages() {
  let client = PostmarkClient::builder()
    .server_token("<sometoken>")
    .build();

  let request = OutboundSearchRequest::builder().build();
  let response = request.execute(&client).await;
}

API coverage

Detailed endpoint matrix and examples:

  • docs/api/postmark-endpoints.md
  • docs/api/examples/
  • docs/api/compatibility.md

Current high-level status:

Section Status
Email implemented
Bulk implemented
Bounce implemented
Templates implemented
Server implemented
Servers implemented
Message Streams implemented
Domains implemented
Sender Signatures implemented (non-deprecated)
Stats implemented
Triggers: Inbound rules implemented
Webhooks implemented
Suppressions implemented
Data Removal implemented
Messages implemented

Releasing a new version

Prerequisite:

cargo install cargo-release

On Release:

cargo release --dry-run
# check it does the good thing
cargo release

Thanks

This crate's API design is heavily inspired by the article "Designing Rust bindings for REST APIs by Ben Boeckel.

License

postmark-rs is dual-licensed under either:

Dependencies

~4–11MB
~188K SLoC