2017 © Pedro Peláez
 

library email-auth

Discover IMAP/SMTP settings, authenticate via any email

image

punarinta/email-auth

Discover IMAP/SMTP settings, authenticate via any email

  • Friday, July 8, 2016
  • by punarinta
  • Repository
  • 1 Watchers
  • 2 Stars
  • 523 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1176 % Grown

The README.md

EmailAuth

A library to authenticate via an arbitrary email or/and to discover IMAP/SMTP settings by email address. Can be for example used in the projects where one doesn't need to keep a user entity in the database, but for which at the same time an authentication with service providers like Google is not enough., (*1)

Installation

  • Install Composer: https://getcomposer.org/download
  • Run php composer.phar require punarinta/email-auth:1.*
  • Assure "autoload.php" file from vendor directory is included

Sample usage

Authentication

use \EmailAuth\Auth;

$auth = new Auth;
if ($auth->login('your@email', 'your-password'))
{
  // You are authenticated.
}
elseif ($auth->status == Auth::STATUS_OAUTH_NEEDED)
{
  // Please authenticate via OAuth.
}
else
{
  // Thou shalt not pass!
}

Discovery

use \EmailAuth\Discover;
$discover = new Discover;

$config = $discover->imap('your@email');
echo "IMAP is on {$config['host']}:{$config['port']}, encryption is $config['encryption']}\n";

$config = $discover->smtp('your@email');
echo "SMTP is on {$config['host']}:{$config['port']}, encryption is $config['encryption']}\n";

Troubleshooting

Fatal error: Call to undefined function imap_open()

No IMAP module is installed for PHP. Here's an example for PHP7 and Ubuntu how to fix it., (*2)

sudo apt-get install php7.0-imap
sudo phpenmod imap

License

This project is licensed under the terms of MIT license., (*3)

The Versions

08/07 2016

dev-master

9999999-dev

Discover IMAP/SMTP settings, authenticate via any email

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Vladimir Osipov

authentication email auth imap smtp dns discover

08/07 2016

v1.0

1.0.0.0

Discover IMAP/SMTP settings, authenticate via any email

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Vladimir Osipov

authentication email auth imap smtp dns discover