Next: , Previous: , Up: guile-email   [Index]


2 Parsing Email

(use-modules (email email))
Scheme Procedure: parse-email (bytevector email)
Scheme Procedure: parse-email (string email)

Parse bytevector email and return result as an <email> record.

Parse string email and return result as an <email> record.

Scheme Procedure: parse-email-headers headers

Parse string headers as email headers and return an association list of header keys and values.

Scheme Procedure: parse-email-body (string headers) (bytevector body)
Scheme Procedure: parse-email-body (string headers) (string body)

Parse bytevector body as email body where headers is an association list of header keys and values as returned by parse-email-headers. Return a list of <mime-entity> records if the body is a multipart message. Else, return a single <mime-entity> record.

Parse string body as email body where headers is an association list of header keys and values as returned by parse-email-headers. Return a list of <mime-entity> records if the body is a multipart message. Else, return a single <mime-entity> record.

Note that while an email can have characters encoded using different schemes, a string is constrained to have all characters encoded using the same scheme. Therefore, passing a string to parse-email or parse-email-body will not always produce correct results. Hence, this variant of parse-email and parse-email-body will be deprecated in the future. This variant is only provided in the interest of backward compatibility.