Skip to content

✅ A Go library for email verification without sending any emails. optimized for bulk emails.

License

Notifications You must be signed in to change notification settings

X0EF/email-verifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

email-verifier

✉️ Fork of email-verifier with added functionality for handling large input emails

Features

  • All existing features of parent project
  • Restapi for handling multiple emails

Install

Use go get to install this package.

go get -u github.com/X0EF/email-verifier

Usage

Basic usage

Use VerifyEmails method to verify an email addresses with different dimensions

package main

import (
	"fmt"
	emailverifier "github.com/AfterShip/email-verifier"
)
var (
	verifier = emailverifier.NewVerifier()
)

func main() {
	emails := ["example@exampledomain.org"]

	ret, err := verifier.VerifyEmails(emails)
	if err != nil {
		fmt.Println("verify email address failed, error is: ", err)
		return
	}
	if !ret.Syntax.Valid {
		fmt.Println("email address syntax is invalid")
		return
	}

	fmt.Println("email validation result", ret)
	/*
		results: {
			"email":"example@exampledomain.org",
			"disposable":false,
			"reachable":"unknown",
			"role_account":false,
			"free":false,
			"syntax":{
			"username":"example",
				"domain":"exampledomain.org",
				"valid":true
			},
			"has_mx_records":true,
			"smtp":null,
			"gravatar":null
		}],
		errors: null
	*/
}

API

We provide a simple self-hosted API server script for reference.

The API interface is very simple. All you need to do is to send a GET request with the following URL.

The email parameter would be the target email you want to verify.

POST to https://{your_host}/v1/bulk/verifications Body

{emails: ["example@mail.com", "sample@email.com"]}

License

This package is licensed under MIT license.

About

✅ A Go library for email verification without sending any emails. optimized for bulk emails.

Resources

License

Stars

Watchers

Forks

Languages

  • Go 100.0%