https://github.com/hsnice16/email-verifier
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.
https://github.com/hsnice16/email-verifier
golang golang-package
Last synced: 9 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/hsnice16/email-verifier
- Owner: hsnice16
- License: mit
- Created: 2024-10-05T13:25:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T11:11:50.000Z (over 1 year ago)
- Last Synced: 2025-09-06T09:35:29.370Z (9 months ago)
- Topics: golang, golang-package
- Language: Go
- Homepage: https://exotic-ranee-hsnice16-19945db3.koyeb.app/swagger/index.html
- Size: 53.7 KB
- Stars: 30
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ✨ Email Verifier


[](https://pkg.go.dev/github.com/hsnice16/email-verifier@v0.2.1/core/service)
> 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:
```shell
go get github.com/hsnice16/email-verifier/core/service
```
---
## 🎬 Quickstart
```go
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)
}
```
```text
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
```shell
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](https://www.docker.com/get-started/) on your local machine for this.
##### • Build the image
```shell
docker build -t hsnice16/email-verifier:1.0 .
```
##### • Run container
```shell
docker run -p 8080:8080 hsnice16/email-verifier:1.0 -- service
```
• • •
#### ➡️ Run manually
##### • Install our command to the `$GOPATH/bin` directory
```shell
go install
```
##### • Run our new command
```shell
cmd
```
##### • Start the core service
```shell
cmd service
```
---
## 💚 Sponsor
If you found this project helpful, then do consider sponsoring it - [Sponsor](https://github.com/sponsors/hsnice16)
And, give it a star 🌟