commit | b974c63f34a6a46ae21074ec0c6a7c9187ec99f0 | [log] [tgz] |
---|---|---|
author | Dusan Kasan <me@dusankasan.com> | Tue Apr 18 12:58:42 2017 +0200 |
committer | Dusan Kasan <me@dusankasan.com> | Tue Apr 18 12:58:42 2017 +0200 |
tree | 461d38f2a50b95512603a4564764f46f557698c9 | |
parent | e668cf21ac5bebb794cd96ad3f29f163fa923a9d [diff] |
Formatting fixed
This library allows for parsing an email message into a more convenient form than the net/mail
provides. Where the net/mail
just gives you a map of header fields and a io.Reader
of its body, Parsemail allows access to all the standard header fields set in RFC5322, html/text body as well as attachements/embedded content as binary streams with metadata.
var reader io.Reader // this reads an email message email, err := parsemail.Parse(reader) // returns Email struct and error if err != nil { // handle error } fmt.Println(email.Subject) fmt.Println(email.From) fmt.Println(email.To) fmt.Println(email.HTMLBody)
It is missing some tests, and needs more work. Use at your own discretion.