Rust

Official Rust SDK — cargo add resent

Install the Resent client:

cargo add resent
cargo add tokio --features macros,rt-multi-thread
use resent::{Resent, SendEmail};
#[tokio::main]
async fn main() -> Result<(), resent::Error> {
let resent = Resent::new(std::env::var("RESENT_API_KEY").expect("RESENT_API_KEY"));
let result = resent
.emails()
.send(
SendEmail::new(
"Acme <noreply@yourdomain.com>",
["you@example.com"],
"Hello World",
)
.html("<strong>It works!</strong>"),
)
.await?;
println!("{:?}", result.submission_id);
Ok(())
}