Rust
Rust
Load MIME Object from Email Object
See more Email Object Examples
Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)Chilkat Rust Downloads
let email = chilkat::Email::new();
let _ = email.load_eml("qa_data/eml/sample.eml").is_ok();
// Write the full MIME of the email to a StringBuilder.
let sb_mime = chilkat::StringBuilder::new();
let _ = email.get_mime_sb(&sb_mime);
// Load the MIME object from the StringBuilder
let mime = chilkat::Mime::new();
let _ = mime.load_mime_sb(&sb_mime).is_ok();
println!("{}", mime.get_mime().unwrap_or_default());