Download the PHP package service-to/validate-email without Composer
On this page you can find all versions of the php package service-to/validate-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download service-to/validate-email
More information about service-to/validate-email
Files in service-to/validate-email
Download service-to/validate-email
More information about service-to/validate-email
Files in service-to/validate-email
Vendor service-to
Package validate-email
Short Description Library to validate an email address against its mail servers by doing a name server lookup and then connecting to its MX records.
License MIT
Homepage https://github.com/ServiceTo/ValidateEmail
Package validate-email
Short Description Library to validate an email address against its mail servers by doing a name server lookup and then connecting to its MX records.
License MIT
Homepage https://github.com/ServiceTo/ValidateEmail
Please rate this library. Is it a good library?
Informations about the package validate-email
ValidateEmail
Library to validate an email address against its mail servers by doing a name server lookup and then connecting to its MX records.
Tired of those pesky fake email addresses in your submission forms?
Add this little bit of majesty to your form validation rules and your server will connect to the MX records and test the validity of the address the user has entered.
It typically only takes a moment to validate a working address and when an invalid address is entered it takes longer, which can be a win, slowing down annoying script kiddies.
Usage
Install using composer...
composer require "service-to/validate-email"
In a Laravel Controller
use ServiceTo\ValidateEmail;
public function store(Request $request) {
$validateemail = new ValidateEmail;
try {
if (!$validateemail->test($request->input("email"))) {
return redirect()->back()->withErrors(["email" => "Invalid Email Address"])
}
}
catch (\ServiceTo\ValidateEmailException $vee) {
return redirect()->back()->withErrors(["email" => "Invalid Email Address (" . $vee->getMessage() . ")"])
}
// rest of checks...
}
In plain old PHP
require_once("vendor/autoload.php");
use ServiceTo\ValidateEmail;
$errors = array();
$validateemail = new ValidateEmail;
try {
if (!$validateemail->test($_REQUEST["email"])) {
$errors["email"] = "Invalid Email Address";
}
}
catch (ServiceTo\ValidateEmailException $vee) {
$errors["email"] = "Invalid Email Address (" . $vee->getMessage() . ")";
}
if (count($errors) > 0) {
// don't move on from here, give the user back some errors...
header("Content-type: application/json");
echo(json_encode(array("response" => "error", "errors" => $errors)));
exit();
}
All versions of validate-email with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package service-to/validate-email contains the following files
Loading the files please wait ....