RFC822 compatible email validation and MX record check.
- Ruby 1.9, 2.0 & 2.1 compatible
- MRI, JRuby and Rubinius compatible
- Email validation
- MX checks (requires ‘host’ command line application)
wget http://github.com/dim/rfc-822/tarball/master
gem install rfc-822
git clone git://github.com/dim/rfc-822.git
ruby script/plugin install git://github.com/dim/rfc-822.git
validates_format_of :email, :with => RFC822::EMAIL
"user@example.com" =~ RFC822::EMAIL ? puts("Email is valid.") : puts("Email is invalid")
RFC822.mx_records('user@mail.com') # => [#<struct RFC822::MXRecord priority=15, host="mailin-01.mx.aol.com">]
Please see LICENSE document
- Inspired by previous work of Cal Henderson, Tim Fletcher and Dan Kubb.