I currently use the nslookup module to check valid mx records for email validation with the following..
I want to take it to the next level and actually do a connect to the mail server and ask if the recipient mailbox exists.
Is this possible in perl and if so how do I go about it?
Which module would I need?
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
Code:
use Net::Nslookup;
my $email = $cgi->param('email');
$email =~ s/[A-Za-z0-9.-_]+\@//g;
my @mx = nslookup(domain => "$email", type => "MX");
if(!@mx){print "Location: [URL unfurl="true"]http://mydomain/error.html\n\n";[/URL] exit();}
I want to take it to the next level and actually do a connect to the mail server and ask if the recipient mailbox exists.
Is this possible in perl and if so how do I go about it?
Which module would I need?
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!