Skip to content

Repository files navigation

Build StatuscodecovGoDoc

With this library you can extract the body and attachments from Transport Neutral Encapsulation Format (TNEF) files.

This work is based on https://github.com/koodaamo/tnefparse and http://www.freeutils.net/source/jtnef/.

Example usage

package main
import (
"io/ioutil""os""github.com/hatching/tnef"
)
funcmain() {
t, err:=tnef.DecodeFile("./winmail.dat")
iferr!=nil {
return
}
wd, _:=os.Getwd()
for_, a:=ranget.Attachments {
ioutil.WriteFile(wd+"/"+a.Title, a.Data, 0777)
}
ioutil.WriteFile(wd+"/bodyHTML.html", t.BodyHTML, 0777)
ioutil.WriteFile(wd+"/bodyPlain.html", t.Body, 0777)
}

About

Go library to extract body and attachments from TNEF files

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages