The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Email::Verify::SMTP - Verify an email address by using SMTP.

SYNOPSIS

  use Email::Verify::SMTP;
  
  # This is important:
  $Email::Verify::SMTP::FROM = 'verifier@my-server.com';
  
  # Just a true/false:
  if( verify_email('foo@example.com') ) {
    # Email is valid
  }
  
  # Find out if, and why not (if not):
  my ($is_valid, $msg) = verify_email('foo@example.com');
  if( $is_valid ) {
    # Email is valid:
  }
  else {
    # Email is *not* valid:
    warn "Email is bad: $msg";
  }

DESCRIPTION

Email::Verify::Simple is what I came with when I needed to verify several email addresses without actually sending them email.

To put that another way:

    This module verifies email addresses without actually sending email to them.

EXPORTED FUNCTIONS

verify_email( $email )

Verifies the supplied email address.

If called in scalar context, eg:

  my $is_valid = verify_email( $email )

then you get a true or false value.

If called in list context, eg:

  my ($is_valid, $why_not) = verify_email( $email )

then you get both a true/false value and any error message that came up.

PUBLIC STATIC VARIABLES

$Email::Verify::SMTP::FROM

Default value: <root@localhost>

This is used as the "from" field on the email that is not actually sent. It should be a valid email address on a real domain - just like if you were sending a normal email.

$Email::Verify::SMTP::DEBUG

Default value: 0

If set to a true value, extra diagnostics will be output to STDERR via warn.

DEPENDENCIES

This module depends on the following:

Net::Nslookup

To discover the mail exchange servers for the email address provided.

IO::Socket::Telnet

A nice socket interface to use, even if you're not using Telnet.

AUTHOR

John Drago <jdrago_999@yahoo.com>

LICENSE

This software is Free software and may be used, copied and redistributed under the same terms as perl itself.