PHP code example of rayhughes / sendgrid-validation
1. Go to this page and download the library: Download rayhughes/sendgrid-validation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
class EmailValidationDto
{
public bool $isValid = false;
public bool $isValidRisk = false;
public bool $isValidScore = false;
public bool $isDisposable = false;
public bool $hasSuggestion = false;
public ?string $suggestion = null;
}
use SendGridValidation\EmailValidation;
use SendGridValidation\Repository\SendGridApiRepository;
$validation = new EmailValidation(
new SendGridApiRepository($apiKey),
true, // bool $allowRisky = true,
true, // bool $allowDisposable = true,
true, // bool $checkValidScore = false,
EmailValidation::MIN_SCORE // float $minScore = self::MIN_SCORE (0.30)
);
$emailValid = $validation->validate($email);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.