Crates.io | temp_mail |
lib.rs | temp_mail |
version | 0.1.6 |
source | src |
created_at | 2023-09-16 12:23:35.322838 |
updated_at | 2023-09-18 08:05:28.058083 |
description | 1secmail api wrapper for rust |
homepage | |
repository | https://github.com/Teyllayka/temp_mail |
max_upload_size | |
id | 974317 |
size | 9,867 |
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:
println!("{}", email.get_email());
email.check_inbox().await?;
let messages = email.get_messages();
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
email.download_attachment(message.id, message.attachments[0].filename.clone(),"file.extension".into()).await?; // not working for images for now
let domains = TempMail::get_domains().await?;
let adresses = TempMail::get_adresses(Some(10)).await?;
let adresses = TempMail::get_adresses(None).await?; // returns 1 adress