Skip to content

Enter an email and verify if it's a valid email or not, written in Go language. Also, exposes the core service to verify an email as a package.

License

Notifications You must be signed in to change notification settings

hsnice16/email-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Verifier

PkgGoDev

Enter an email and verify if it's a valid email or not.

Installation

email-verifier exposes the core service to verify an email. You can get that using:

go get github.com/hsnice16/email-verifier/core/service

Quickstart

package main

import (
  "fmt"

  "github.com/hsnice16/email-verifier/core/service"
)

func main() {
  fmt.Printf("Hello, Email Verifier\n\n")

  email := "xyz@"
  result, err := service.VerifyEmail(email, service.VerifyEmailOptions{ValidateRegex: true})
  fmt.Printf("Is %+v a Valid Email?: %v\n", email, result)
  fmt.Printf("%+v\n\n", err)

  email = "xyz@example.com"
  result, err = service.VerifyEmail(email, service.VerifyEmailOptions{
    ValidateRegex:       true,
    ValidateMxRecord:    true,
    ValidateSmtpRunning: true,
  },
  )
  fmt.Printf("Is %+v a Valid Email?: %v\n", email, result)
  fmt.Println(err)
}
Hello, Email Verifier

Is xyz@ a Valid Email?: false
Invalid Email Address: Regex check failed

Is xyz@example.com a Valid Email?: false
Invalid Email Address: Mx record not found

If you liked the project then give it a star (⭐️) and consider sponsoring it (❤️).

About

Enter an email and verify if it's a valid email or not, written in Go language. Also, exposes the core service to verify an email as a package.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages