MooseX::Types::Email - Email address validation type constraints for Moose.
package MyClass; use Moose; use MooseX::Types::Email qw/EmailAddress EmailMessage EmailAddresses EmailMessages/; use namespace::autoclean; has email => ( isa => EmailAddress, required => 1, is => 'ro' ); has message => ( isa => EmailMessage, required => 1, is => 'ro' ); has emails => ( isa => EmailAddresses, required => 1, is => 'ro' ); has messages => ( isa => EmailMessages, required => 1, is => 'ro' );
EmailMessage must be an object that can be passed to Email::Abstract. Currently, constraining strings is not supported due to the leniency of Email::Abstract.
Shamelessly extracted from Reaction::Types::Email.
<email@example.com> added support for validating email messages.
<firstname.lastname@example.org> added support for lists of email addresses and messages.
Tomas Doran (t0m) <email@example.com
This software is copyright (c) 2009 by Tomas Doran (t0m).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.