temp_mail

Crates.iotemp_mail
lib.rstemp_mail
version0.1.6
sourcesrc
created_at2023-09-16 12:23:35.322838
updated_at2023-09-18 08:05:28.058083
description1secmail api wrapper for rust
homepage
repositoryhttps://github.com/Teyllayka/temp_mail
max_upload_size
id974317
size9,867
Teyllay (Teyllayka)

documentation

README

temp_mail

Async Rust wrapper of 1secmail

use temp_mail::TempMail;

let mut email = TempMail::new();
email.generate_email().await?;


// or

let mut email2 = TempMail::from_string("myemail@something.com").await?;

now you can retrieve:

Email address

println!("{}", email.get_email());

Email messages

email.check_inbox().await?;

let messages = email.get_messages();

Open message

let message = email.get_message_by_id(id).await?

// message.id
// message.from
// message.subject
// message.date
// message.body
// message.text_body
// message.html_body
// message.attachments ->
// attachment.filename
// attachment.content_type
// attachment.size

Download attachment

email.download_attachment(message.id, message.attachments[0].filename.clone(),"file.extension".into()).await?; // not working for images for now

Get available domains

let domains = TempMail::get_domains().await?;

Get random addresses

let adresses = TempMail::get_adresses(Some(10)).await?;
let adresses = TempMail::get_adresses(None).await?; // returns 1 adress
Commit count: 9

cargo fmt