Skip to content

Instantly share code, notes, and snippets.

@bobbywilson0
Created April 4, 2012 19:18
Show Gist options
  • Save bobbywilson0/2304876 to your computer and use it in GitHub Desktop.
Save bobbywilson0/2304876 to your computer and use it in GitHub Desktop.
require 'resolv'
def valid_email_domain(domain)
Resolv::DNS.open do |dns|
mail_servers = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
if mail_servers && !mail_servers.empty?
true
else
false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment