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

Data::Validate::Mailbox - Verify that the given mailbox exists

VERSION

Version 0.10

SYNOPSIS

Verify that the given mailbox exists.

If you find any issues in using the module, please don't hesitate to email me: Jefp@gmx.de

    use Data::Validate::Mailbox;

    my $mbx = Data::Validate::Mailbox->new;

    # or,
    my $mbx = Data::Validate::Mailbox->new(debug => 1,
                                           localhost => 'foo.org',
                                           localuser => 'user@foo.org',
                                          );

    my $res;
    $res = $mbx->validate('tester@gmx.de');
    $res = $mbx->validate('tester@gmail.com');
    $res = $mbx->validate('tester@orange.fr');
    $res = $mbx->validate('tester@hotmail.com');

    # 1 means existing, 0 means non-existing
    print $res;

Please note,

1. This module just uses Net::SMTP to try to deliver messages to peer MTA. If the remote mailbox doesn't exist, peer MTA will return a message such as "mailbox unavailable".

2. Some email providers don't behave like above, such as Yahoo/AOL, so this module won't work for them.

SUBROUTINES/METHODS

new

New the object.

Please note,

For many email providers, you have to provide the correct local hostname for sending email to them. The hostname must match:

1. It is your valid domain/host name.

2. The hostname has an IP address, and a correct PTR for this IP (PTR match back to hostname).

3. The domain has valid MX records and/or SPF records.

4. The IP has good reputation (not listed in any DNSBL).

If you can't send messages to those providers, please setup your right localhost and localuser options in new() method.

validate

Validate if the given mailbox exists. Return 1 for existing, 0 for non-existing.

AUTHOR

Yonghua Peng, <pyh at cpan.org>

BUGS

Please report any bugs or feature requests to bug-data-validate-mailbox at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Validate-Mailbox. 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 Data::Validate::Mailbox

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2023 by Yonghua Peng.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)