Rust Requires Chilkat v11.0.0+
Rust
Access Attached Message (Embedded Email)
How to access an email embedded within another email (i.e. an attached message).Chilkat Rust Downloads
let email = chilkat::Email::new();
// Load an email from a .eml
if email.load_eml("embeddedEmail.eml").is_err() {
println!("{}", email.last_error_text());
return;
}
// Display how many attached emails are embedded within
// this one:
let num_attached = email.num_attached_messages();
println!("numAttached = {}", num_attached);
// Get the 1st attached message.
let email2 = chilkat::Email::new();
if email.get_attached_email(0, &email2).is_ok() {
// Display the subject, From, and a header field...
println!("{}", email2.subject());
println!("{}", email2.from());
println!("{}", email2.get_header_field("X-SOMETHING").unwrap_or_default());
}