All Projects → zytzagoo → Smtp Validate Email

zytzagoo / Smtp Validate Email

Licence: gpl-3.0
A PHP library for performing email addresses validation via SMTP

Projects that are alternatives of or similar to Smtp Validate Email

Server Accepts Email
Check if an SMTP server accepts emails to a given address
Stars: ✭ 24 (-93.2%)
Mutual labels:  smtp, email-validation
Check If Email Exists
Check if an email address exists without sending any email, written in Rust.
Stars: ✭ 497 (+40.79%)
Mutual labels:  smtp, email-validation
Deep Email Validator
Validates regex, typos, disposable, dns and smtp
Stars: ✭ 436 (+23.51%)
Mutual labels:  smtp, email-validation
mailcat
Find existing email addresses by nickname using API/SMTP checking methods without user notification. Please, don't hesitate to improve cat's job! 🐱🔎 📬
Stars: ✭ 219 (-37.96%)
Mutual labels:  email-validation, smtp
Kamifaka
一款基于VUE3.0的开源免费的卡密发卡系统,高效、稳定可靠。
Stars: ✭ 253 (-28.33%)
Mutual labels:  smtp
php-smtp
Simple PHP SMTP Mail Send Script
Stars: ✭ 57 (-83.85%)
Mutual labels:  smtp
NeverBounceAPI-PHP
This package provides convenient methods to integrate the NeverBounce API into your project.
Stars: ✭ 22 (-93.77%)
Mutual labels:  email-validation
tmail
A throwaway smtp server with API
Stars: ✭ 13 (-96.32%)
Mutual labels:  smtp
Sockethub
A protocol gateway for the Web.
Stars: ✭ 329 (-6.8%)
Mutual labels:  smtp
Deltachat Core Rust
Delta Chat Rust Core library, used by Android/iOS/desktop apps and bindings
Stars: ✭ 300 (-15.01%)
Mutual labels:  smtp
Notqmail
Collaborative open-source successor to qmail
Stars: ✭ 255 (-27.76%)
Mutual labels:  smtp
ESP-Mail-Client
⚡️Arduino Mail Client Library to send, read and get incoming mail notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.
Stars: ✭ 78 (-77.9%)
Mutual labels:  smtp
Espoofer
An email spoofing testing tool that aims to bypass SPF/DKIM/DMARC and forge DKIM signatures.🍻
Stars: ✭ 273 (-22.66%)
Mutual labels:  smtp
dist-detect
Try to determine what Linux/Unix distribution is running on a remote host and get a hint if security updates are applied.
Stars: ✭ 14 (-96.03%)
Mutual labels:  smtp
Airform
Functional HTML forms for Front-End Developers.
Stars: ✭ 307 (-13.03%)
Mutual labels:  smtp
haraka-plugin-mongodb
Plugin for the Haraka SMTP server to store incoming and outgoing emails to MongoDB
Stars: ✭ 25 (-92.92%)
Mutual labels:  smtp
mxclient
A minimalist client for sending mail direct to recipient's MX
Stars: ✭ 29 (-91.78%)
Mutual labels:  smtp
Phpmailer
The classic email sending library for PHP
Stars: ✭ 17,485 (+4853.26%)
Mutual labels:  smtp
jolimail
Send nice emails
Stars: ✭ 78 (-77.9%)
Mutual labels:  smtp
Excision-Mail
Fullstack, security focused mailserver based on OpenSMTPD for OpenBSD using ansible
Stars: ✭ 108 (-69.41%)
Mutual labels:  smtp

SMTP_Validate_Email

PHP Version Software License Build Status Scrutinizer Coverage

Perform email address validation/verification via SMTP.

The SMTPValidateEmail\Validator class retrieves MX records for the email domain and then connects to the domain's SMTP server to try figuring out if the address really exists.

Earlier versions (before 1.0) used the SMTP_Validate_Email class name (and did not use namespaces and other now-common PHP features). Care has been taken to keep the old API and migrating old code should be painless. See "Migrating to 1.0 from older versions" section. Or just use/download the ancient 0.7 version.

Features

  • Not actually sending the message, gracefully resetting the SMTP session when done
  • Command-specific communication timeouts implemented per relevant RFCs
  • Catch-all account detection
  • Batch mode processing supported
  • Logging/debugging support
  • No external dependencies
  • Covered with unit/functional tests

Installation

Install via composer:

composer require zytzagoo/smtp-validate-email --update-no-dev

Usage examples

Basic example

<?php

require 'vendor/autoload.php';

use SMTPValidateEmail\Validator as SmtpEmailValidator;

/**
 * Simple example
 */
$email     = '[email protected]';
$sender    = '[email protected]';
$validator = new SmtpEmailValidator($email, $sender);

// If debug mode is turned on, logged data is printed as it happens:
// $validator->debug = true;
$results   = $validator->validate();

var_dump($results);

// Get log data (log data is always collected)
$log = $validator->getLog();
var_dump($log);

Multiple recipients and other details

<?php

require 'vendor/autoload.php';

use SMTPValidateEmail\Validator as SmtpEmailValidator;

/**
 * Validating multiple addresses/recipients at once:
 * (checking multiple addresses belonging to the same server
 * uses a single connection)
 */
$emails    = [
    '[email protected]',
    '[email protected]'
];
$sender    = '[email protected]';
$validator = new SmtpEmailValidator($emails, $sender);
$results   = $validator->validate();

var_dump($results);

/**
 * The `validate()` method accepts the same parameters
 * as the constructor, so this is equivalent to the above:
 */
$emails    = [
    '[email protected]',
    '[email protected]'
];
$sender    = '[email protected]';
$validator = new SmtpEmailValidator();
$results   = $validator->validate($emails, $sender);

var_dump($results);

Migrating to 1.0 from older versions

Earlier versions used the global SMTP_Validate_Email classname. You can keep using that name in your existing code and still switch to the newer (composer-powered) version by using aliasing/importing like this:

Require the composer package:

composer require zytzagoo/smtp-validate-email --update-no-dev

And then in your code:

<?php

require 'vendor/autoload.php';

use SMTPValidateEmail\Validator as SMTP_Validate_Email;

// Now any old code referencing `SMTP_Validate_Email` should still work as it did earlier

Development & Contributions

See the Makefile and the development dependencies in composer.json.

Running make once you clone (or download) the repository gives you:

Usage: make [target]

[target]                       help
--------                       ----
help                           What you're currently reading
install                        Installs dev dependencies
clean                          Removes installed dev dependencies
test                           Runs tests
coverage                       Runs tests with code coverage
server-start                   Stops and starts the smtp server
server-stop                    Stops smtp server if it's running
(PIDFILE)                      Starts the smtp server
(MAILHOG)                      Downloads platform-specific mailhog binary

So, run make install to get started. Afterwards you should be able to run the tests (make test).

Tests are powered by phpunit and a local ./bin/mailhog instance running on port 1025. Tests requiring an SMTP server are marked as skipped (if/when the SMTP server is unavailable).

Pull requests are welcome!

In order to get your pull request merged, please follow these simple rules:

  • all code submissions must pass cleanly (no errors) with make test
  • stick to existing code style (phpcs is used)
  • there should be no external dependencies
  • if you want to add significant features/dependencies, file an issue about it first so we can discuss whether the addition makes sense for the project

Changelog

License (GPL-3.0+)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].