Skip to content

Instantly share code, notes, and snippets.

@curt
Created March 18, 2010 15:46
Show Gist options
  • Save curt/336486 to your computer and use it in GitHub Desktop.
Save curt/336486 to your computer and use it in GitHub Desktop.
Valid e-mail address in Ruby
require 'tmail'
def email_valid?(email)
TMail::Address.parse(email)
rescue TMail::SyntaxError
false
else
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment