checkmail is a simple go package to check the validity of an email, it can check:
- Format
- Domain validity
- Mailbox existance, by checking the user and mailbox host
go get -u github.com/loopcontext/checkmail
email := "[email protected]"
err := ValidateFormat(email)
if err != nil {
fmt.Printf(`"%s" -> format error: %q`, mail, err)
}
// Send email ...
email := "[email protected]"
err := ValidateHost(email)
if err != nil {
fmt.Printf(`"%s" -> host error: %q`, mail, err)
}
// Send email ...