This API validates e-mails in "user@mail.com" format, checking also the smtp server.
The API uses GET method to send request. Below you can find sample synax.
GET
https://apineo.app/email-validation/?email=yourname@website.com
Below you can find a "valid" response sample.
GET
https://apineo.app/email-validation/?email=info@neoadvanced.com
{
"success": true,
"result": "valid",
"email": "info@neoadvanced.com",
"host": "neoadvanced.com",
"smtp_check": "valid",
"mx_record": "mail.neoadvanced.com",
"execution_time_spent": 0.048582077026367188
}
Below you can find an "invalid" response sample.
GET
https://apineo.app/email-validation/?email=info@yourtt.com
{
"success": true,
"result": "invalid",
"email": "info@yourtt.com",
"smtp_check": "false",
"info": "Only valid email addresses are allowed.",
"valid_syntax_example": "https://apineo.app/email-validation/?email=yourname@website.com",
"execution_time_spent": 0.12897109985351562
}
Below you can find an "error" response.
GET
https://apineo.app/email-validation/?ema
{
"success": false,
"error": "Error. You must provide an email address.",
"valid_syntax_example": "https://apineo.app/email-validation/?email=yourname@website.com",
"execution_time_spent": 5.817413330078125e-5
}
Below you can find a usage sample php code using cURL.
<?php
//Validation function using cURL
function validate_email($email){
$ch = curl_init("https://apineo.app/email-validation/?email=".$email."");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
$validationResult = json_decode($json, true);
if($validationResult["result"]=="valid"){
return true;
}else{
return false;
}
}
//USAGE
if(validate_email("yourname@website.com")){
//do success code ...
}else{
//do error code ...
}
?>