PHP code example of romanzipp / laravel-mailcheck

1. Go to this page and download the library: Download romanzipp/laravel-mailcheck 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/ */

    

romanzipp / laravel-mailcheck example snippets


namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function handleEmail(Request $request)
    {
        $request->validate([
            'email' => '

$checker = new \romanzipp\MailCheck\Checker;

// Validate domain
$validDomain = $checker->allowedDomain('ich.wtf');

// Validate mail address (uses domain check endpoint internally)
$validEmail = $checker->allowedEmail('[email protected]');

return [
    // ... 
    'decision_rate_limit' => \romanzipp\MailCheck\Enums\ApiIssue::EXCEPTION,
];

return [
    // ... 
    'decision_no_mx' => \romanzipp\MailCheck\Enums\ApiIssue::EXCEPTION,
];

return [
    // ... 
    'decision_invalid' => \romanzipp\MailCheck\Enums\ApiIssue::EXCEPTION,
];
diff
- config/mailcheck.php
+ config/mailcheck.php

php artisan vendor:publish --provider="romanzipp\MailCheck\Providers\MailCheckProvider"

php artisan migrate