Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.1 KB

File metadata and controls

41 lines (31 loc) · 1.1 KB

checkmail

Godoc Reference Coverage Go Report Card

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

Install

go get -u github.com/loopcontext/checkmail

Example

Check email format

email := "email@email.com"
err := ValidateFormat(email)
if err != nil {
    fmt.Printf(`"%s" -> format error: %q`, mail, err)
}
// Send email ...

Check the host and email existance

email := "email@email.com"
err := ValidateHost(email)
if err != nil {
    fmt.Printf(`"%s" -> host error: %q`, mail, err)
}
// Send email ...