The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Email::IsEmail - Checks an email address against the following RFCs: 3696, 1123, 4291, 5321, 5322

VERSION

Version 3.04.0

SYNOPSIS

Checks an email address against the following RFCs: 3696, 1123, 4291, 5321, 5322

Example usage:

    use Email::IsEmail;

    my $valid = Email::IsEmail('test@example.org');
    ...

CONSTANTS

AUTHOR

Original PHP version Dominic Sayers <dominic@sayers.cc> Perl version Leandr Khaliullov, <leandr at cpan.org>

BUGS

Please report any bugs or feature requests to bug-email-isemail at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Email-IsEmail. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Email::IsEmail

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2008-2011 Dominic Sayers. Copyright 2016 Leandr Khaliullov.

This program is released under the following license: BSD

COPYRIGHT

To validate an email address according to RFCs 5321, 5322 and others

Copyright © 2008-2011, Dominic Sayers Test schema documentation Copyright © 2011, Daniel Marschall All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    - Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    - Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    - Neither the name of Dominic Sayers nor the names of its contributors may be
      used to endorse or promote products derived from this software without
      specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@package Email::IsEmail @author Dominic Sayers <dominic@sayers.cc> @copyright 2008-2011 Dominic Sayers @license http://www.opensource.org/licenses/bsd-license.php BSD License @link http://www.dominicsayers.com/isemail @version 3.04.1 - Changed my link to http://isemail.info throughout

The quality of this code has been improved greatly by using PHPLint Copyright (c) 2010 Umberto Salsi This is free software; see the license for copying conditions. More info: http://www.icosaedro.it/phplint/

SUBROUTINES/METHODS

IsEmail

Check that an email address conforms to RFCs 5321, 5322 and others

As of Version 3.0, we are now distinguishing clearly between a Mailbox as defined by RFC 5321 and an addr-spec as defined by RFC 5322. Depending on the context, either can be regarded as a valid email address. The RFC 5321 Mailbox specification is more restrictive (comments, white space and obsolete forms are not allowed)

@param string $email The email address to check @param boolean $checkDNS If true then a DNS check for MX records will be made @param int $errorlevel Determines the boundary between valid and invalid addresses. Status codes above this number will be returned as-is, status codes below will be returned as Email::IsEmail::VALID. Thus the calling program can simply look for Email::IsEmail::VALID if it is only interested in whether an address is valid or not. The errorlevel will determine how "picky" Email::IsEmail() is about the address.

                                If omitted or passed as -1 then Email::IsEmail() will return
                                true or false rather than an integer error or warning.

                                NB Note the difference between $errorlevel = -1 and
                                $errorlevel = 0
@param array    $parsedata      If passed, returns the parsed address components