mailcheck

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 6 Imported by: 0

README

Mailcheck

Go library to verify, detect invalid, spam and junk email id.

Features:
  • Identify disposable and free email providers
  • The API also automatically checks for role-based emails (such as sales@domain.com or team@domain.com)

Usage

go get github.com/deepakputhraya/mailcheck

Example

package main

import (
	"fmt"
	"github.com/deepakputhraya/mailcheck"
)

var emails = []string{"elon@tesla.com", "elon@gmail.com", "hello@mailinator.com"}

func main() {
	for _, email := range emails {
		// Skipped error handling
		details, _ := mailcheck.GetEmailDetails(email)
		fmt.Println(email)
		fmt.Printf("Valid : %v; Disposable : %v; Free : %v; Role Based : %v\n",
			details.IsValid,
			details.IsDisposable,
			details.IsFree,
			details.IsRoleBased)
		fmt.Println("-----")
	}
}

API

The library can also be accessed through an API.

https://mailcheck-go.herokuapp.com/validate?email=elon@tesla.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailDetails

type EmailDetails struct {
	Email        string `json:"email"`
	Domain       string `json:"domain"`
	IsValid      bool   `json:"is_valid"`
	IsDisposable bool   `json:"is_disposable"`
	IsRoleBased  bool   `json:"is_role_based"`
	IsFree       bool   `json:"is_free"`
	Username     string `json:"username"`
}

func GetEmailDetails

func GetEmailDetails(email string) (EmailDetails, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL