I am trying to verify all the E-mail addresses in my database without sending any actual e-mails. I'm using Email::Verify::SMTP, which seems to work, except that it reports EVERY e-mail address as invalid. Below is the actual subroutine (validate_EMAIL) preceded by some pseudo code showing how I invoke the subroutine.
The $EMAIL_ADDRESS field of each $MEMBER_rec will contain at least one address and may contain multiple addresses delimited by a semicolon. The subroutine will break this scalar into individual addresses and validate each one separately, then report the whole block back to the main section.
The original author is no longer reachable via e-mail, so I'm looking for help from anyone who has had success with this package.
## psuedo code: use Email::Verify::SMTP; $f3 = "font size=3"; $f0 = "/font"; foreach $MEMBER_rec (@MEMBER_data) { (undef,$EMAIL_ADDRESS,undef, ...) = splip(/\|/,$MEMBER_rec); &validate_EMAIL; print STDOUT "$EMAIL_ADDRESS\n"; } exit; sub validate_EMAIL { # This is important: $Email::Verify::SMTP::FROM = 'webmaster@$hostnm'; $return_EMAIL = ""; $tmp_EMAIL = $EMAIL_ADDRESS; $tmp_EMAIL =~ s/\s//g; # Get rid of any whitespace. @tmp_EMAIL = split(/;/,$tmp_EMAIL); foreach $tmp_EMAIL_lc (@tmp_EMAIL) { $tmp_EMAIL_lc =~ tr/A-Z/a-z/; # Find out if, and why not (if not): my ($is_valid, $msg) = verify_email('$tmp_EMAIL_lc'); if( $is_valid ) # Email is valid: $return_EMAIL .= "; <$f3>$tmp_EMAIL_lc<$f0>"; } else { # Email is *not* valid: $return_EMAIL .= "; <$f3 color=RED>$tmp_EMAIL_lc<$f0>"; } } $return_EMAIL =~ s/^; //; $return_EMAIL =~ s/; /<br>/g; $EMAIL_ADDRESS = $return_EMAIL; }
In reply to Verifying Email Addresses by knuppn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |