fgribreau/mailchecker

临时(一次性/丢弃)电子邮件检测库。涵盖1987个虚假电子邮件提供商。

资助包维护!
fgribreau

v6.0.9 2024-09-11 10:00 UTC

README

PyPi version PyPI - Downloads

Cargo version Crates.io

NPM version npm

Gem version Gem

Packagist version Packagist

GoDoc

Get help on Codementor available-for-advisory extra Slack

跨语言电子邮件验证。由一个包含超过55,000个可丢弃电子邮件域的数据库支持。

当您需要联系用户并希望避免导致沟通不畅或想要阻止“垃圾邮件邮箱”的错误时,这将非常有帮助。

需要在您的SaaS中提供Webhooks吗?

需要将图表嵌入到电子邮件中吗?

使用 Image-Charts 就可以了,不再有服务器端渲染的痛苦,1个URL = 1个图表。

https://image-charts.com/chart?
cht=lc // chart type
&chd=s:cEAELFJHHHKUju9uuXUc // chart data
&chxt=x,y // axis
&chxl=0:|0|1|2|3|4|5| // axis labels
&chs=873x200 // size

免费使用Image-Charts

升级

从3.x到4.x

  • PHP
# import using the fully qualified name.
use Fgribreau\MailChecker;

// ...
echo MailChecker::isValid('[email protected]');

从1.x到3.x

Mailchecker公共API已被标准化,以下是更改

  • NodeJS/JavaScript: MailChecker(email) -> MailChecker.isValid(email)
  • PHP: MailChecker($email) -> MailChecker::isValid($email)
  • Python
import MailChecker
m = MailChecker.MailChecker()
if not m.is_valid('[email protected]'):
  # ...

变为

import MailChecker
if not MailChecker.is_valid('[email protected]'):
  # ...

MailChecker目前支持

使用方法

NodeJS

var MailChecker = require('mailchecker');

if(!MailChecker.isValid('[email protected]')){
  console.error('O RLY !');
  process.exit(1);
}

if(!MailChecker.isValid('myemail.com')){
  console.error('O RLY !');
  process.exit(1);
}

JavaScript

<script type="text/javascript" src="MailChecker/platform/javascript/MailChecker.js"></script>
<script type="text/javascript">
if(!MailChecker.isValid('[email protected]')){
  console.error('O RLY !');
}

if(!MailChecker.isValid('myemail.com')){
  console.error('O RLY !');
}
</script>

PHP

use Fgribreau\MailChecker;

require __DIR__ . '/vendor/autoload.php';

if(!MailChecker::isValid('[email protected]')){
  die('O RLY !');
}

if(!MailChecker::isValid('myemail.com')){
  die('O RLY !');
}

Python

pip install mailchecker
# no package yet; just drop in MailChecker.py where you want to use it.
from MailChecker import MailChecker

if not MailChecker.is_valid('[email protected]'):
    print "O RLY !"

Django 验证器:https://github.com/jonashaag/django-indisposable

Ruby

require 'mail_checker'

unless MailChecker.valid?('[email protected]')
  fail('O RLY!')
end

Rust

 extern crate mailchecker;

assert_eq!(true, mailchecker::is_valid("[email protected]"));
assert_eq!(false, mailchecker::is_valid("\n[email protected]\n"));
assert_eq!(false, mailchecker::is_valid("[email protected]"));

Elixir

Code.require_file("mail_checker.ex", "mailchecker/platform/elixir/")

unless MailChecker.valid?("[email protected]") do
  raise "O RLY !"
end

unless MailChecker.valid?("myemail.com") do
  raise "O RLY !"
end

Clojure

; no package yet; just drop in mailchecker.clj where you want to use it.
(load-file "platform/clojure/mailchecker.clj")

(if (not (mailchecker/valid? "[email protected]"))
  (throw (Throwable. "O RLY!")))

(if (not (mailchecker/valid? "myemail.com"))
  (throw (Throwable. "O RLY!")))

Go

package main

import (
  "log"
  
  "github.com/FGRibreau/mailchecker/platform/go"
)

if !mail_checker.IsValid('myemail@yopmail.com') {
  log.Fatal('O RLY !');
}

if !mail_checker.IsValid('myemail.com') {
  log.Fatal("O RLY !")
}

安装

Go

go get https://github.com/FGRibreau/mailchecker

NodeJS/JavaScript

npm install mailchecker

Ruby

gem install ruby-mailchecker

PHP

composer require fgribreau/mailchecker

我们接受其他包管理器的pull-requests.

数据源

TorVPN

  $('td', 'table:last').map(function(){
    return this.innerText;
  }).toArray();

BloggingWV

  Array.prototype.slice.call(document.querySelectorAll('.entry > ul > li a')).map(function(el){return el.innerText});

... 请将您的数据集添加到list.txt中.

从list.txt重新生成库

只需运行(需要NodeJS)

npm run build

开发

开发环境需要docker

# install and setup every language dependencies in parallel through docker
npm install

# run every language setup in parallel through docker
npm run setup

# run every language tests in parallel through docker
npm test

支持者

维护者

这些了不起的人正在维护此项目

赞助商

还没有赞助商!你将是第一个吗?

Patreon donate button Gratipay donate button Flattr donate button PayPal donate button crypto donate button

贡献者

这些了不起的人为这个项目贡献了代码

通过访问CONTRIBUTING.md文件了解如何贡献。

变更日志

许可证

除非另有说明,所有作品均为

并授权于