Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Mailboxvalidator Bundle

Mailboxvalidator Bundle Laravel Package

mailboxvalidator/mailboxvalidator-bundle

Symfony bundle that wraps the MailboxValidator email verification API, letting you check addresses for deliverability, disposable domains, and role-based inboxes directly in your PHP app. Use it to clean signup forms and mailing lists before sending.

View on GitHub
Deep Wiki
Context7

MailboxValidator Symfony bundle enable users to block disposal email, detect free email and validate if an email is valid

Frequently asked questions about Mailboxvalidator Bundle
How do I install the MailboxValidator Symfony bundle?
Install it with Composer using composer require mailboxvalidator/mailboxvalidator-bundle. Then register the bundle in your Symfony application, either in config/bundles.php for Symfony Flex projects or in the Kernel for older versions. After that, publish or create the bundle configuration file so you can supply your API key. Restart or clear the cache and the validation service becomes available from the container.
Can I use mailboxvalidator/mailboxvalidator-bundle in a Laravel application?
This package is a Symfony bundle, so it depends on Symfony's bundle registration and service container, which Laravel does not provide. You cannot register it directly inside a Laravel app the way you would a Laravel package. In Laravel, the practical route is to call the MailboxValidator REST API through Laravel's HTTP client, or use the vendor's plain PHP SDK wrapped in your own service class. That keeps your signup validation logic framework-agnostic while still hitting the same verification endpoints.
What exactly does the bundle check on an email address?
It wraps the MailboxValidator verification API, so a single call can tell you whether an address is syntactically valid and deliverable, whether it belongs to a disposable or temporary email provider, and whether it is a free webmail account or a role-based inbox such as admin@ or support@. The API response typically also includes domain and MX details plus a status code explaining why an address was rejected. You can then decide which signals should block a signup or suppress a mailing list entry.
How do I block disposable email addresses on a signup form?
Call the bundle's validation service from your form handler or a Symfony constraint-backed validator, then inspect the disposable flag in the returned result. If the address is flagged as disposable, reject the registration with a clear error message instead of storing it. Many teams also check the free-email and role-based flags so they can allow those but require extra verification. Log the raw API status so support can explain rejections to users.
How do I configure my MailboxValidator API key?
You need an API key from your MailboxValidator account dashboard, which you pass through the bundle's configuration. Put the key in an environment variable such as an API key placeholder in your .env file and reference that variable from the bundle config so secrets stay out of version control. Each validation call consumes API credits, so use a separate key per environment where possible. Check the README for the exact configuration key names for your bundle version.
Which PHP and Symfony versions does this bundle support?
The supported PHP and Symfony component ranges are declared in the package's composer.json, so check that file or run composer why-not to confirm compatibility with your project. Because the bundle depends on Symfony services and configuration components, an outdated Symfony major version can block installation. If you are on an unsupported version, you can still call the MailboxValidator API directly from your application code. Pinning to a release that matches your framework version is the safest approach.
How do I validate an email address in my controller or service?
Inject the bundle's validation service into your controller, form handler, or a dedicated service class through constructor autowiring. Call the validation method with the address, then read the result object or array for the validity, disposable, free, and role flags. Keep the API call behind your own small wrapper interface so you can swap providers or add caching later. Returning a simple boolean plus a reason code to your controller keeps the presentation layer clean.
Can I clean a large mailing list with this bundle?
The underlying API validates one address per call and consumes a credit per call, so cleaning a large list means many requests and a plan sized for that volume. Run the work in background queue jobs with rate limiting and retries rather than inside a web request. Store results with a timestamp so you do not re-verify the same address repeatedly, and cache outcomes for addresses you see often. Watch for API rate limits and back off when you receive throttling responses.
How should I handle API timeouts and failures in production?
Wrap the validation call in a try/catch and configure an HTTP timeout so a slow upstream cannot stall your signup flow. Decide deliberately between failing open, where you accept the address and verify later, and failing closed, where you reject or queue it for manual review. Log failures with enough context to debug them, and consider a circuit breaker if the API is unavailable for an extended period. Never let a verification outage take down the whole registration endpoint.
How do I test email validation without using up API credits?
Because the bundle calls an external service, the reliable approach is to mock or stub the validator service in your test container rather than hitting the real API. In Symfony, register a fake implementation in config/services_test.yaml or use the test container to replace the service with a stub returning fixed valid, disposable, and invalid responses. Write separate tests for the happy path, a disposable rejection, and an API error case. This keeps your test suite fast, deterministic, and free of credit consumption.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console