Skip to content

Simple go package to check whether an email has a valid format or even if the mailbox exists

License

Notifications You must be signed in to change notification settings

LoopContext/checkmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ...

About

Simple go package to check whether an email has a valid format or even if the mailbox exists

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages