Crate tempmail

source ·
Expand description

§Tempmail

A Rust library for interacting with temporary email services.

This library provides functionality to manage temporary email addresses, retrieve messages, and download attachments using various temporary email domains.

§Example

use tempmail::{Domain, Tempmail};

#[tokio::main]
async fn main() {
    // Create a new Tempmail instance with a custom username and domain.
    let tempmail = Tempmail::new("example", Some(Domain::SecMailOrg));

    // Get a list of messages from the temporary email inbox.
    let messages = tempmail.get_messages().await;

    match messages {
        Ok(messages) => {
            for message in messages {
                println!("From: {}", message.from);
                println!("Subject: {}", message.subject);
                println!("Timestamp: {}", message.timestamp);
            }
        }
        Err(error) => {
            eprintln!("Error: {}", error);
        }
    }
}

The Tempmail library allows you to create a temporary email address, retrieve messages from the inbox, and download attachments associated with messages.

The library defines several data structures, enums, and methods to facilitate these interactions. Refer to the documentation for individual struct and enum definitions for more details.

Structs§

  • Represents an attachment associated with an email message.
  • Represents an email message received in the temporary email inbox.
  • Represents a raw version of an email message with minimal information.
  • Represents a temporary email address with associated domain for receiving emails.

Enums§

  • Enum representing different temporary email domains.

Type Aliases§