Categorygithub.com/loopcontext/checkmail
modulepackage
0.0.1
Repository: https://github.com/loopcontext/checkmail.git
Documentation: pkg.go.dev

# README

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 protected]"
err := ValidateFormat(email)
if err != nil {
    fmt.Printf(`"%s" -> format error: %q`, mail, err)
}
// Send email ...

Check the host and email existance

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

# Functions

NewSMTPError creates a new STMPError instance.
ValidateFormat validates email format.
ValidateHost validates host.

# Variables

Error vars.
Error vars.

# Structs

STMPError describes an error from the SMTP server.