Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teamwork/tnef
Go library to extract body and attachments from TNEF files
https://github.com/teamwork/tnef
go tnef
Last synced: 3 days ago
JSON representation
Go library to extract body and attachments from TNEF files
- Host: GitHub
- URL: https://github.com/teamwork/tnef
- Owner: Teamwork
- License: mit
- Created: 2016-01-19T16:32:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T16:28:13.000Z (over 1 year ago)
- Last Synced: 2024-06-20T08:17:21.994Z (5 months ago)
- Topics: go, tnef
- Language: Go
- Homepage:
- Size: 857 KB
- Stars: 16
- Watchers: 64
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/Teamwork/tnef.svg?branch=master)](https://travis-ci.com/Teamwork/tnef)
[![codecov](https://codecov.io/gh/Teamwork/tnef/branch/master/graph/badge.svg)](https://codecov.io/gh/Teamwork/tnef)
[![GoDoc](https://godoc.org/github.com/Teamwork/tnef?status.svg)](https://godoc.org/github.com/Teamwork/tnef)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
```go
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)
}
```