wsw/email

Value Object E-mail

Maintainers

Details

github.com/whera/Email

Source

Issues

Installs: 20 868

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/wsw/email

1.1.0 2017-08-10 11:55 UTC

This package is auto-updated.

Last update: 2025-09-29 01:55:48 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.