Skip to content

euliancom/checkmail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

checkmail

Golang package for email validation.

GoDoc

Usage

1. Format

    func main() {
		err := checkmail.ValidateFormat("ç$€§/[email protected]")
		if err != nil {
			fmt.Println(err)
		}
	}

output: invalid format

2. Domain

    func main() {
		err := checkmail.ValidateHost("[email protected]")
		if err != nil {
			fmt.Println(err)
		}
	}

output: unresolvable host

3. User

    func main() {
		err := checkmail.ValidateHost("[email protected]")
		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.

About

Golang package for email validation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%