checkemail

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Email Validator

There is golang package to Validate email address syntax, check email domain, check smtp and that mail user exists.

GoDoc Go Report Card

Basic usage example

Look example at examples/validate_email folder

cd examples/validate_email
go run . -e myemail@example.com

Licence

BSD

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat  = errors.New("invalid format")
	ErrDomainRequired = errors.New("domain is required")
)

Functions

func ValidateEmail

func ValidateEmail(s string) error

ValidateEmail validates email address regex

func ValidateHost

func ValidateHost(email string) (err error)

ValidateHost validate mail host. This function checks emails hosts mx record and try connect to smtp server with timeout.

func ValidateMX

func ValidateMX(email string) error

ValidateMX validate if MX record exists for a domain

func ValidateUser

func ValidateUser(serverHostName, serverMailAddress, email string) (err error)

ValidateUser validate mail host and user. If host is valid, requires valid SMTP [1] serverHostName and serverMailAddress to reverse validation for prevent SPAN and BOTS.

[1] https://mxtoolbox.com/SuperTool.aspx

Types

This section is empty.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL