Mail address parsing library for Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
.gitignore
.travis.yml
Gopkg.lock
Gopkg.toml
LICENSE
README.markdown
README.md
address.go
address_test.go
doc.go
list.go
list_test.go
mailaddress.go
mailaddress_test.go
parse.go
parse_go_test.go
parse_test.go

README.markdown

Build Status codecov GoDoc Go Report Card

The mailaddress package parses email addresses.

It's an alternative to net/mail; significant differences include:

  • Better errors.
  • When parsing a list it will continue to the next address on an error; this is especially useful when providing feedback to users.
  • Some useful utility functions.

Basic example:

addr, err := mailaddress.Parse(`Martin <single_address@example.com>`)

addrs, haveErr := mailaddress.ParseLint(`many@example.com, addresses@example.com`)
if haveErr {
	fmt.Println(addrs.Errors())
}

See godoc for more docs.