[reloop-email]
Rust
Send email from Rust with an async-first crate built for performance-critical applications.
1
Install the Rust package
bash
cargo add reloop-email2
Send email from Rust
send_email.rs
1use reloop_email::ReloopEmail;2
3#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5 let reloop = ReloopEmail::new(std::env::var("RELOOP_API_KEY")?, None);6
7 let email = reloop8 .emails()9 .send(reloop_email::SendEmailParams {10 from: "Acme <onboarding@yourdomain.com>".into(),11 to: vec!["delivered@yourdomain.com".into()],12 subject: "Hello from Rust".into(),13 html: Some("<strong>It works!</strong>".into()),14 ..Default::default()15 })16 .await?;17
18 println!("Email sent: {}", email.id);19 Ok(())20}3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with Rust.
Get an API key and ship transactional email from Rust using the official SDK.