Download the PHP package martian/spammailchecker without Composer
On this page you can find all versions of the php package martian/spammailchecker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download martian/spammailchecker
More information about martian/spammailchecker
Files in martian/spammailchecker
Package spammailchecker
Short Description A laravel package that protect users from entering non-existing/spam email addresses.
License MIT
Homepage https://github.com/hendurhance/laravel-spam-email
Rated 5.00 based on 1 reviews
Informations about the package spammailchecker
Laravel SpamMailChecker
A powerful Laravel package designed to effortlessly validate email addresses against various spam mail providers using a diverse range of drivers. Seamlessly integrated with Laravel's validation system, this package offers comprehensive support for validating email inputs in forms and RESTful APIs
Supported Email Validation Services
| Service | Descriptions | Driver | Documentation | Supported |
|---|---|---|---|---|
| Local | A local text list of spam email domains. | local | Read More | ✅ Yes |
| Remote | Using PHP In-built functions getmxrr(), checkdnsrr(). fsockopen() to validate email domain |
remote | Read More | ✅ Yes |
| AbstractApi | Using Abstract's suite of API to validate email domains | abstractapi | Read More | ✅ Yes |
| QuickEmailVerification | A reliable, accurate, affordable, and advanced email verification service | quickemailverification | Read More | ✅ Yes |
| Verifalia | A web-based email validation service which allows to upload and validate lists of email addresses with ease | verifalia | Read More | ✅ Yes |
| SendGrid | A cloud-based SMTP provider that allows you to validate email addresses before you send. | sendgrid | Read More | ✅ Yes |
NOTE: More services will be added soon. (You can also contribute to this project by adding more services - ZeroBounce, Mailboxlayer, EmailListVerify, Emailable, etc)
Installation
You can install the package via composer:
- If you are going to be using the facade, you'll need to register it as well. Open
config/app.phpand add the following line to thealiasesarray:
Publish Configuration File
Publish the configuration file using the following command:
Configuration
The configuration file is located at config/laravel-spammail-checker.php. You may configure the package to use any of the supported drivers. The default driver is local which uses a local text list of spam email domains.
Local Driver Configuration
-
In order to use
localas your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file tolocal: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable tolocalin your.envfile. -
The local driver uses a local text list of spam email domains. The file is located at
resources/config/emails.txt. You can include more domains by adding them to theblacklistarray or exclude domains by adding them to thewhitelistarray. - Clear the config and cache using the following commands after making changes to the configuration file:
NOTE: The local driver is case-insensitive. So, you don't need to worry about the case of the email domain.
Remote Driver Configuration
-
In order to use
remoteas your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file toremote: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable toremotein your.envfile. - The remote driver uses PHP In-built functions
getmxrr(),checkdnsrr().fsockopen()to validate email domain. You can configure the remote driver on whether to check for MX -getmxrr(), DNS -checkdnsrr(), and SMTP -fsockopenor validate email domain. You can also configure the timeout value in seconds.
AbstractApi Driver Configuration
-
In order to use
abstractapias your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file toabstractapi: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable toabstractapiin your.envfile. -
Add your
ABSTRACTAPI_API_KEYAbstractAPI key you got from here to yourenvfile. - You can configure the
scoreto determine the threshold for a valid email address. The score ranges from 0 to 1. The higher the score, the more likely the email address is valid. You can also accept disposable email addresses by settingaccept_disposabletotrue.
QuickEmailVerification Driver Configuration
-
In order to use
quickemailverificationas your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file toquickemailverification: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable toquickemailverificationin your.envfile. -
Add your
QUICKEMAILVERIFICATION_API_KEYQuickEmailVerification key you got from here to yourenvfile. - You can configure the driver to accept disposable email addresses by setting
accept_disposabletotrue.
Verifalia Driver Configuration
-
In order to use
verifaliaas your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file toverifalia: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable toverifaliain your.envfile. -
In order to use verifalia service, you need to set login credentials in your
envfile. You can get your credentials from after you create a user here. - You can configure the driver to accept disposable email addresses by setting
accept_disposabletotrue.
NOTE: A user on verifalia needs to be granted permission to use the API. You can do this by going here and clicking on the edit user you want to grant permission to. Then click on the
Permissionstab and check the appropriate permissions onEmail validationssection.
SendGrid Driver Configuration
-
In order to use
sendgridas your driver of choice, you need to set thedefaultkey in theconfig/laravel-spammail-checker.phpconfiguration file tosendgrid: -
Or you can set the
SPAM_MAIL_CHECKER_DEFAULT_DRIVERenvironment variable tosendgridin your.envfile. -
Add your
SENDGRID_API_KEYSendgrid key you got from here to yourenvfile. - You can configure the driver to accept disposable email addresses by setting
accept_disposabletotrue. Score can also be configured to determine the threshold for a valid email address. The score ranges from 0 to 1. The higher the score, the more likely the email address is valid. Source can also be configured to determine the source of the email address. The source can besignuporcontact.
Usage
In order to use the package, you need to call the spammail validation rule in your validation rules. You can also change the rule name to whatever you want in the config/laravel-spammail-checker.php configuration file under the rule key, likewise the error message under the error_message key.
Or make use of spammail in your Requests file like this:
Adding Custom Error Message
A custom error message can be added to the spammail validation rule.
Or you can change the error message in the config/laravel-spammail-checker.php configuration file under the error_message key.
Using Classes Directly
You can also use the classes directly without using the spammail validation rule. This is useful when you want to use the package in your own custom validation rule or your own custom class.
Using Facade
You can also use the SpamMailChecker class directly without instantiating it.
Using Each Driver Individually
You can also use each driver individually without using the spammail validation rule. This is useful when a certain driver is needed in a particular situation.
Using VerifaliaDriver
Using SendGridDriver
Using AbstractApiDriver
Using RemoteDriver
Using LocalDriver
Using QuickEmailVerificationDriver
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please feel free to fork this project and make a pull request. For more information check CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Josiah Endurance
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of spammailchecker with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0
laravel/framework Version ^10.0|^11.0|^12.0
quickemailverification/quickemailverification Version *