-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displaying email content #82
Comments
Hi there! Yes, the old version of this crate did not parse the response that comes back from the server, and instead had you parse it out yourself. As of #58, that has changed, but it does mean that there are some attributes that we don't expose just because we haven't though of them :) The Alternatively, you can request |
Thank you for the support @jonhoo ! let domain = "imap.gmail.com";
let port = 993;
let socket_addr = (domain, port);
let ssl_connector = TlsConnector::builder().unwrap().build().unwrap(); //Using native-tls = "0.1"
let mut imap_socket = Client::secure_connect(socket_addr, domain, &ssl_connector).unwrap();
imap_socket
.login("[email protected]", "password")
.unwrap();
match imap_socket.select("INBOX") {
Ok(mailbox) => {
println!("{}", mailbox);
}
Err(e) => println!("Error selecting INBOX: {}", e),
};
match imap_socket.fetch("2", "RFC822") {
Ok(messages) => {
for message in messages.iter() {
let lines: Vec<&str> = str::from_utf8(message.rfc822().unwrap())
.unwrap()
.split("\n")
.collect();
for i in 0..lines.len() {
println!("Lines[{}] {}", i, lines[i]);
}
}
}
Err(e) => println!("Error Fetching email 2: {}", e),
};
imap_socket.logout().unwrap(); |
Hello, I used a previous versions of this crate to fetch and get the email content, but with the updated version i don't find anything on how to access the contents of the fetch.
Previously i fetched and got my reponsse like this:
But now even with this and the example you give, I only get a list of flags and some ID/UID
Fetch { message: 348, flags: ["\\Seen"], uid: None, rfc822_header: None, rfc822: None }Mailbox emails number = 538
I have looked in the documentation and found that now fetch return a vector of imap::Fetch, but i am not abble to find anything leading to my fetch content.
Also, i am very new to RUST so i don't really understand all i am doing 😕
The text was updated successfully, but these errors were encountered: