Golang package for email validation
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE init repo Jan 26, 2017
README.md Fix README flavored markdown typo Jun 22, 2017
checkmail.go remove duplicate conn timeout' Dec 10, 2018
checkmail_test.go remove duplicate conn timeout' Dec 10, 2018

README.md

checkmail

Golang package for email validation.

GoDoc

Usage

1. Format

    func main() {
		err := checkmail.ValidateFormat("ç$€§/az@gmail.com")
		if err != nil {
			fmt.Println(err)
		}
	}

output: invalid format

2. Domain

    func main() {
		err := checkmail.ValidateHost("email@x-unkown-domain.com")
		if err != nil {
			fmt.Println(err)
		}
	}

output: unresolvable host

3. User

    func main() {
		err := checkmail.ValidateHost("unknown-user-129083726@gmail.com")
		if smtpErr, ok := err.(checkmail.SmtpError); ok && err != nil {
			fmt.Printf("Code: %s, Msg: %s", smtpErr.Code(), smtpErr)
		}
	}

output: Code: 550, Msg: 550 5.1.1 The email account that you tried to reach does not exist.

License

Checkmail is licensed under the MIT License.