2017 © Pedro Peláez
 

library smtp-validator

A simple laravel package that validates your smtp credentials without sending a test mail

image

samolabams/smtp-validator

A simple laravel package that validates your smtp credentials without sending a test mail

  • Saturday, March 3, 2018
  • by samolabams
  • Repository
  • 2 Watchers
  • 6 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Smtp Validator

This laravel package can be used to validate your smtp credentials without sending a test mail, (*1)

Package Installation

Require this package in your composer.json file and update composer., (*2)

composer require samolabams/smtp-validator
  • If you are on laravel 5.5 and above, thats all you need to do.
  • If your laravel version is < 5.5, you'll need to register a service provider and optionally add a facade. Open up config/app and the following to your providers array:
Samolabams\SmtpValidator\SmtpValidatorServceProvider::class,

Optionally, you can also use a facade for shorter code:, (*3)

'SmtpValidator' => Samolabams\SmtpValidator\SmtpValidatorFacade::class,

Usage

Create a new validation with the "newValidation" method with your hostname and port(default port is 25) as parameters, optionally add a username and password, encryption type and "validate" VOILA!!!., (*4)

Use the App container, (*5)

$smtpValidator = App::make('smtp-validator');
$smtpValidator->newValidation($host, $port);
$smtpValidator->validate();

Or use the facade, (*6)

SmtpValidator::newValidation($host, $port)->validate();

If you have a smtp username/password and encryption, you can chain them to the validation calls

SmtpValidator::newValidation($host, $port)->setUsername($username)->setPassword($password)->setEncryption($encryption)->validate();

Response, (*7)

The validate method returns a response object, with a success property (true/false value) and an optional message property which tells you the reason why your smtp credentials is invalid.

$response = SmtpValidator::newValidation($host, $port)->validate();
if ($response->success === true) {
  // GOOD TO GO!!!
} else {
  // SOMETHING WENT WRONG!!!
  $message = $response->message;
}

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities., (*8)

License

This Smtp Validator is licensed under the MIT License - see the LICENSE file for details, (*9)

The Versions

03/03 2018

dev-master

9999999-dev https://github.com/samolabams/smtp-validator

A simple laravel package that validates your smtp credentials without sending a test mail

  Sources   Download

MIT

The Requires

 

by Sam Olabamiji

laravel validator validation validate smtp samolabams laravel-smtp

03/03 2018

1.0.0

1.0.0.0 https://github.com/samolabams/smtp-validator

A simple laravel package that validates your smtp credentials without sending a test mail

  Sources   Download

MIT

The Requires

 

by Sam Olabamiji

laravel validator validation validate smtp samolabams laravel-smtp