← all modules
module

stdlib::mail::message

defined in C:\Users\bye45\.glide\bin/src/stdlib/mail/message.glide

Parse an RFC 5322 message into a Mail. Splits header block from body

struct struct Attachment
struct struct Mail
fn fn parse_mail(raw: string) -> !*Mail

Parse an RFC 5322 message into a Mail. Splits header block from body and decodes the headline fields. MIME multipart bodies are kept as the raw body string — full MIME parsing is deferred (good enough for round-trip metadata access in v1).

glide
let raw: string = pop3.retr(1).val;
let r: !*Mail = parse_mail(raw);
if r.ok {
    println!("from:", r.val.from);
    println!("subject:", r.val.subject);
}