Skip to content

Latest commit

 

History

History
136 lines (90 loc) · 2.72 KB

README.md

File metadata and controls

136 lines (90 loc) · 2.72 KB

✨ 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 🌟