wsw/email

Value Object E-mail

1.1.0 2017-08-10 11:55 UTC

This package is auto-updated.

Last update: 2024-10-29 04:36:46 UTC


README

Value object for handling email-type values

Scrutinizer Code Quality Code Coverage Build Status

Installation

Via Composer:

composer require wsw/email

Usage

<?php

use WSW\Email\Email;

try {
    $email = new Email('ronaldo@whera.com.br');

    echo $email->getEmail();    // (string) ronaldo@whera.com.br
    echo $email->getUsername(); // (string) ronaldo
    echo $email->getHostname(); // (string) whera.com.br
    print_r($email->getMx());   // (array) list mx records

    echo $email; // (string) ronaldo@whera.com.br

} catch (\InvalidArgumentException $e) {
    echo $e->getMessage();
}

Testing

$ composer test

Security

If you discover any security related issues, please email ronaldo@whera.com.br instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.