commit | 4595dfeb3596d13a1ef2a3e0f3262cda4c8cae11 | [log] [tgz] |
---|---|---|
author | Dusan Kasan <me@dusankasan.com> | Thu Apr 13 00:38:24 2017 +0200 |
committer | Dusan Kasan <me@dusankasan.com> | Thu Apr 13 00:38:24 2017 +0200 |
tree | 70fa11e486a75178cb643bf9ebfb37cb7be44c9b | |
parent | a67f959446072ce70114c316302ae6db8dd5a955 [diff] |
Goimports and gofmt applied
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.