使用Laravel验证存在的电子邮件



有人知道如何验证Laravel中存在的电子邮件吗?不仅是有效的电子邮件通过它的域名等,但我需要真正存在的电子邮件在这个世界上。提前谢谢你。

你可以使用像Trumail这样的API

发出这个请求:https://api.trumail.io/v2/lookups/<format>?email=<email>

它将返回一些关于所提供的电子邮件的信息,其中一个信息是deliverable,如果它是一个真实的电子邮件,它的值为true

访问emailable.com并创建一个帐户以获取API密钥

发送GET请求到https://api.emailable.com/v1/verify?email=email@gmail.com&api_key=live_xxxxx

您应该得到如下响应

{
"accept_all": false,
"did_you_mean": null,
"disposable": false,
"domain": "gmail.com",
"duration": 0.036,
"email": "xxxx.email@gmail.com",
"first_name": null,
"free": true,
"full_name": null,
"gender": null,
"last_name": null,
"mx_record": "gmail-smtp-in.l.google.com",
"reason": "accepted_email",
"role": false,
"score": 95,
"smtp_provider": "Google",
"state": "deliverable",
"tag": null,
"user": "email user"
}

statedeliverable时,表示邮件有效,undeliverable表示邮件无效,无法接收邮件。

最新更新