leancaptain/lara-email
LeanCaptain Lara Email is a Laravel package that simplifies working with email in your application, offering a lightweight, configurable layer over Laravel's mailer for composing and sending messages with Blade templates and your existing mail drivers.
Install the package with Composer:
composer require leancaptain/lara-email
No service provider registration or config publishing is required. Look first at the LeanCaptain\LaraEmail\Rules\UsableEmailDomain rule class and the bundled disposable-domain snapshot/metadata if you need to understand which domains are blocked.
The first practical use case is signup or registration email validation: reject reserved example domains, bundled disposable domains (and their subdomains), and domains without a usable MX record.
use LeanCaptain\LaraEmail\Rules\UsableEmailDomain;
'email' => [
'bail',
'required',
'string',
'email',
new UsableEmailDomain,
],
Use it alongside Laravel’s normal email rule. It does not verify mailbox existence or ownership, so keep your normal email confirmation flow.
FormRequest usage. Put the rule after format validation and use bail so DNS/MX checks only run for otherwise valid input.
public function rules(): array
{
return [
'email' => [
'bail',
'required',
'string',
'email',
new UsableEmailDomain,
],
];
}
Inline validator usage. The rule is a standard Laravel validation rule object, so it works with Validator::make() and other rule arrays.
Validator::make($request->all(), [
'email' => ['bail', 'required', 'email', new UsableEmailDomain],
]);
Reusable rule sets. For multiple signup, invite, newsletter, or lead-capture forms, define the email rule set once in a shared class/helper rather than repeating the stack. This keeps disposable-domain and MX behavior consistent across entry points.
Avoid duplicating DNS work. The package performs MX checks itself. Do not casually stack email:dns on top unless you intentionally want multiple DNS-related checks; keep the built-in email rule for syntax and this rule for domain/MX policy.
Caching expectations. Successful MX checks can be cached, bounded by DNS TTL and capped at five minutes. Failed checks are never cached. Treat this as short-lived protection only; it is not a long-lived DNS cache. The release notes do not document a published config file, so inspect the rule constructor/package source if you need to confirm how caching is enabled or tuned.
High-volume flows. Validation runs synchronously and performs DNS lookups, so use bail and consider rate limiting or other abuse controls on public signup endpoints. This rule is best used at account creation or lead capture, not on every request for an already-known email address.
How can I help you explore Laravel packages today?