Skip to content

eevans/rfc2822

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RFC2822 Parser For Go

This a simple rfc2822 parser for Go. It does not (currently )support the full standard.

Installation

goinstall github.com/eevans/rfc2822

Usage

package main

import (
    "github.com/eevans/rfc2822"
    "os"
    "fmt"
)

func main() {
    var (
        msg   *rfc2822.Message
        err   os.Error
        value string
    )

    if msg, err = rfc2822.ReadFile("message.txt"); err != nil {
        fmt.Printf("error reading file: %s\n", err)
        os.Exit(2)
    }

    if value, err = msg.GetHeader("subject"); err != nil {
        fmt.Println(err)
        os.Exit(3)
    }

    fmt.Printf("Subject: %s\n", value)
}

About

RFC 2822 parser for Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages