guerrillamail-client 0.3.0

Async Rust client for GuerrillaMail temporary email service
Documentation

guerrillamail-client

Crates.io Documentation License: MIT

GuerrillaMail

An async Rust client for the GuerrillaMail temporary email service.

Features

  • 🚀 Async/await - Built on tokio and reqwest
  • 📧 Create temporary emails - Generate disposable email addresses
  • 📬 Check inbox - Retrieve messages from your temporary inbox
  • 🗑️ Delete emails - Clean up when done
  • 🌐 Proxy support - Route requests through HTTP proxies

Installation

Add to your Cargo.toml:

[dependencies]

guerrillamail = "0.1"

tokio = { version = "1", features = ["full"] }

Quick Start

use guerrillamail::Client;

#[tokio::main]
async fn main() -> Result<(), guerrillamail::Error> {
    // Create a new client
    let client = Client::new().await?;
    
    // Create a temporary email address
    let email = client.create_email("myalias").await?;
    println!("Temporary email: {}", email);
    
    // Check for messages
    let messages = client.get_messages(&email).await?;
    for msg in messages {
        println!("From: {}", msg.mail_from);
        println!("Subject: {}", msg.mail_subject);
    }
    
    // Delete when done
    client.delete_email(&email).await?;
    
    Ok(())
}

If you need custom configuration (proxy, TLS, user agent), use the builder:

use guerrillamail::Client;

let client = Client::builder()
    .proxy("http://127.0.0.1:8080")
    .danger_accept_invalid_certs(false)
    .user_agent("my-app/1.0")
    .ajax_url("https://www.guerrillamail.com/ajax.php")
    .build()
    .await?;

Acknowledgements

This library is a Rust port of GuerrillaMail-Python.

License

MIT License - see license for details.