Denzil Kruse wrote:
Gunnar Hjalmarsson wrote:
What you can do is testing if the domain/host has an MX record.
And you can of course test the syntax, but that's it.

Okay, that sounds like Mail::Verify then.

I had a look at the source of Mail::Verify, and even if the module claims to verify the syntax, it doesn't really. You may want to check out e.g. Email::Valid, too.

Or: This is a function I'm using in a couple of programs to check the
syntax, and that I believe is sufficient in practice:

    sub emailsyntax {
        return 1 unless
          my ($localpart, $domain) = shift =~ /^(.+)@(.+)/;
        my $char = '[^()<>@,;:\/\s"\'&|.]';
        return 1 unless $localpart =~ /^$char+(?:\.$char+)*$/ or
          $localpart =~ /^"[^",]+"$/;
        $domain =~ /^$char+(?:\.$char+)+$/ ? 0 : 1;
    }

OTOH, since you know that the addresses were valid once, the syntax
check may not be your first priority.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to