rfc-822 icon indicating copy to clipboard operation
rfc-822 copied to clipboard

Library for RFC822 compatible email validation and MX record checks

h1. RFC822

RFC822 compatible email validation and MX record check.

h2. Features

  • Ruby 1.9, 2.0 & 2.1 compatible
  • MRI, JRuby and Rubinius compatible
  • Email validation
  • MX checks (requires 'host' command line application)

h2. Installation

h6. Download from GitHub

bc. wget http://github.com/dim/rfc-822/tarball/master

h6. As a GEM

bc. gem install rfc-822

h6. Clone from GitHub

bc. git clone git://github.com/dim/rfc-822.git

h6. As a Rails plugin

bc. ruby script/plugin install git://github.com/dim/rfc-822.git

h2. Usage Examples

bc. validates_format_of :email, :with => RFC822::EMAIL

bc. "[email protected]" =~ RFC822::EMAIL ? puts("Email is valid.") : puts("Email is invalid")

bc. RFC822.mx_records('[email protected]') # => [#<struct RFC822::MXRecord priority=15, host="mailin-01.mx.aol.com">]

h2. License

Please see LICENSE document

h2. Acknowledgements

  • Inspired by previous work of Cal Henderson, Tim Fletcher and Dan Kubb.