From: Justin Collins Date: 2006-03-08T05:55:04+09:00 Subject: Re: Valid email address from CGI input? John N. Alegre wrote: > Is there any Ruby package that will check a input email for validity? I > want to take a submitted email address from a form and at least make the > domain is real. I would not be so much concerned in validating the actual > user in that domain but it would be nice. > > I have seen some system calls to route that can do this but I was looking > for something more Ruby 'ish. > > john > You could possibly use the socket library for simple domain verification... For example: > irb(main):001:0> require 'socket' > => true > irb(main):002:0> Socket.gethostbyname("google.com") > => ["google.com", [], 2, "H\016\317c", "@\351\273c", "@\351\247c"] -Justin