Mail::Verify - Utility to verify an email address
use Mail::Verify;
Mail::Verify provides a function CheckAddress function for verifying email addresses. First the syntax of the email address is checked, then it verifies that there is at least one valid MX server accepting email for the domain. Using Net::DNS and IO::Socket a list of MX records (or, falling back on a hosts A record) are checked to make sure at least one SMTP server is accepting connections.
Mail::Verify
Here are a list of return codes and what they mean:
The email address appears to be valid.
No email address was supplied.
There is a syntaxical error in the email address.
There are no DNS entries for the host in question (no MX records or A records).
There are no live SMTP servers accepting connections for this email address.
This example shows obtaining an email address from a form field and verifying it.
use CGI qw/:standard/; use Mail::Verify; my $q = new CGI; [...] my $email = $q->param("emailaddr"); my $email_ck = Mail::Verify::CheckAddress( $email ); if( $email_ck ) { print '<h1>Form input error: Invalid email address.</h1>'; } [...]
6 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
Expected text after =item, not a number
You forgot a '=back' before '=head1'
To install Mail::Verify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Verify
CPAN shell
perl -MCPAN -e shell install Mail::Verify
For more information on module installation, please visit the detailed CPAN module installation guide.