Created
March 18, 2010 15:46
-
-
Save curt/336486 to your computer and use it in GitHub Desktop.
Valid e-mail address in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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