Class: MX::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/mx-validator.rb

Class Method Summary collapse

Class Method Details

.validate(email) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/mx-validator.rb', line 9

def validate(email)
  # simple regex check
  return false unless RegexValidator.validate(email)

  # get list of smtp servers
  smtp_server = Resolver.new(email).smtp_servers().first

  # final validation
  connect_to_smtp_validate(email, smtp_server)
end