mailme

Async POP3 client impl with Rust.

View the Project on GitHub PrivateRookie/mailme

mailme

Async POP3 client impl with Rust.

supported methods

some pop3 server may not some methods list below

example

add tokio and mailme to dep

tokio = { version = "0.3.1", features = ["io-util", "io-std", "net", "rt", "rt-multi-thread"] }
mailme = "0.1.1"

then just connect, login and do something

use pop3::POP3Client;
use tokio::runtime::Runtime;

fn main() {
    let rt = Runtime::new().unwrap();
    rt.block_on(async {
        // if not tls connection, use new_basic instead
        // mailme use Mozilla's root certificates
        // you can add pem file path to use your self signed cert
        // let mut client = POP3Client::new_tls("pop.qq.com", 995, Some(<pem_file_path>)).await.unwrap();
        let mut client = POP3Client::new_tls("pop.qq.com", 995, None).await.unwrap();
        // remember to read welcome message
        println!("{:?}", client.read_welcome().await);
        // login
        println!("{:?}", client.user("PrivateRookie").await);
        println!("{:?}", client.pass("踏遍青山人未老").await);

        // do some thing
        println!("{:?}", client.stat().await);
    })
}

Todos

Refs