All Projects → Teamwork → tnef

Teamwork / tnef

Licence: MIT license
Go library to extract body and attachments from TNEF files

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Build Status codecov GoDoc

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/teamwork/tnef"
)

func main() {
	t, err := tnef.DecodeFile("./winmail.dat")
	if err != nil {
		return
	}
	wd, _ := os.Getwd()
	for _, a := range t.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)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].