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 and as an endpoint.

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

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Email Verifier

Forks Stars 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

⚙️ Develop Locally

Pull the code

git clone git@github.com:hsnice16/email-verifier.git
cd email-verifier

Run in a Docker Container or start the server manually

➡️ Run in a Docker Container

You will need docker on your local machine for this.

• Build the image
docker build -t hsnice16/email-verifier:1.0 .
• Run container
docker run -p 8080:8080 hsnice16/email-verifier:1.0 -- service
• • •

➡️ Run manually

• Install our command to the $GOPATH/bin directory
go install
• Run our new command
cmd
• Start the core service
cmd service

💚 Sponsor

If you found this project helpful, then do consider sponsoring it - Sponsor

And, give it a star 🌟

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 and as an endpoint.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published