How do I verify that an email address targets a valid recipient?
Without sending mail to the address and seeing whether there’s a human on the other end to answer you, you cannot fully answer part b, but either the Email::Valid or the RFC::RFC822::Address module will do both part a and part b as far as you can in real-time. If you want to just check part a to see that the address is valid according to the mail header standard with a simple regular expression, you can have problems, because there are deliverable addresses that aren’t RFC-2822 (the latest mail header standard) compliant, and addresses that aren’t deliverable which, are compliant. However, the following will match valid RFC-2822 addresses that do not have comments, folding whitespace, or any other obsolete or non-essential elements.