Project

cogi_email

0.0
No commit activity in last 3 years
No release in over 3 years
This gem provide you library to validate, parsing and format email. Check is email is in blacklist or not.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10.0
~> 2.0

Runtime

~> 2.5
 Project Readme

CogiEmail Build Status Coverage Status GitHub issues Gem Version

This gem provide you library to validate, parsing and format email. Check is email is real or not.

Installation

Add this line to your application's Gemfile:

gem 'cogi_email'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cogi_email

Usage

Validation

Check if a string is a valid email address.

CogiEmail.validate? 'nobi.younet@gmail.com' # => true

Normalization

Normalize phone numer to international format.

CogiEmail.normalize 'Nobi.younet@gmail.com' # => 'nobi.younet@gmail.com'
CogiEmail.normalize '(Nobi)<nobi.younet@gmail.com>' # => 'nobi.younet@gmail.com'

Validate email domain

Check if email domain is valid by making a DNS lookup.

CogiEmail.valid_email_domain? 'nobi.younet@gmail.com' # => true
CogiEmail.valid_email_domain? 'nobi.younet@localhost' # => false

Check if real email

Check if an email address is real or not.

An email address is real if:

  • Is valid
  • Has MX DNS record
  • Can send a test email
CogiEmail.real_email? 'nobi.younet@gmail.com' # => true
CogiEmail.real_email? 'nobi.younet@localhost' # => false

Credit

Thank you Kamil Ciemniewski so much for writing email_verifier gem. I reference his gem to re-writing email checker for this gem.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Don't forget to add tests and run rspec before creating a pull request :)

See all contributors on https://github.com/hoahm/cogi_email/graphs/contributors.