#tm #client #asynchronous #mailtm #account-credentials

mailtm-client

An asynchronous and simple client for Mail.tm

7 releases

0.1.15 Jun 25, 2024
0.1.14 Jun 25, 2024

#147 in Email

Download history 26/week @ 2024-07-24 10/week @ 2024-07-31 13/week @ 2024-09-11 5/week @ 2024-09-18 4/week @ 2024-09-25

128 downloads per month

MIT license

8KB
145 lines

MailTM Client

crates.io Build status

An asynchronous and simple client for Mail.tm.

Getting started

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let account_credentials =
        mailtm_client::AccountCredentials::new("User123", "my_secret_password");

    let email_client = mailtm_client::Client::new(&account_credentials).await?;

    let mail;
    loop {
        if let Some(html) = email_client.request_latest_message_html().await? {
            mail = html;
            break;
        }
        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
    }

    Ok(())
}

Dependencies

~9–21MB
~287K SLoC