Transparent Email clears aliases from email address. Email [email protected]
will be transformed to [email protected]
.
To detect multi-accounts on your website.
- gmail.com and Google Apps with custom domain
- tlen.pl
- 33mail.com
- outlook.com
- yahoo.com
- icloud.com
- yandex.ru
- mail.ru
use bkrukowski\TransparentEmail\TransparentEmailFactory;
use bkrukowski\TransparentEmail\Emails\Email;
use bkrukowski\TransparentEmail\Emails\EmailInterface;
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
try {
$factory = new TransparentEmailFactory();
$cleaner = $factory->createDefault();
$inputEmail = new Email('[email protected]');
/** @var EmailInterface $transformedEmail */
$transformedEmail = $cleaner->getPrimaryEmail($inputEmail);
echo $transformedEmail;
} catch (InvalidEmailException $exception) {
echo 'Invalid email!';
}
The version numbers follow the Semantic Versioning 2.0.0 scheme.
Aliases work different on Yahoo than on Gmail. On Gmail part after plus is skipped.
For example message sent to [email protected]
will be redirected to [email protected]
.
Yahoo uses the following pattern*:
baseName-keyword@yahoo.com
- baseName - value defined by the user, different than email login;
- keyword - one from a list of keywords defined by the user.
Therefore we do not know what is the real email, so in this case result will be [email protected]
,
which actually does not exist.
In official documentation you can find some use-cases about aliases usage.
Mail.ru service uses following aliases:
[email protected]
will be redirected to[email protected]
[email protected]
will be redirected to[email protected]
Icloud.com service uses following aliases:
[email protected]
will be redirected to[email protected]
[email protected]
will be redirected to[email protected]