Official Library

Ruby Email Verification Gem

The official Ruby gem for EmailVerify.io. Build elegant, high-performance email validation and lead discovery features into your Rails, Sinatra, or pure Ruby applications.

Free plan available. No credit card required.

sdk-example.worker

Gem Installation

Install the EmailVerify gem using RubyGems.

terminal
$ gem install emailverify

Ruby Examples

1 Standard Email Verification

Elegant and idiomatic Ruby integration. Our official gem provides a clean API for performing real-time SMTP handshakes and domain analysis directly from your Ruby scripts or web applications.

ruby
require 'email_verify'

client = EmailVerify::Client.new('your_api_key')
result = client.verify('[email protected]')

puts "Deliverable!" if result.valid?

2 High-Volume Batch API

Offload large-scale verification tasks. The batch system is designed for marketing teams and developers who need to verify lists of thousands of emails without blocking their main application flow.

ruby
emails =['[email protected]', '[email protected]']
batch = client.batches.create(emails)

# Check status later
status = client.batches.get(batch.id).status
if status == 'completed'
  results = client.batches.results(batch.id)
end

3 Advanced Client Setup

Configure for stability. Customize request timeouts and proxy settings to ensure the gem behaves correctly within your specific infrastructure and meets your application's latency requirements.

ruby
client = EmailVerify::Client.new(
  api_key: 'your_api_key',
  timeout: 5,        # 5 second timeout
  open_timeout: 2,   # 2 second connection timeout
  proxy: 'http://my-proxy.com:80'
)

4 Lead Discovery (Finder)

Boost your outreach efforts. The Finder API intelligently predicts and verifies professional email addresses, giving you a powerful tool for lead generation and business development.

ruby
lead = client.finder.search(
  first_name: 'John',
  last_name: 'Wick',
  domain: 'continental.com'
)

puts "Email: #{lead.email} (#{lead.confidence}%)" if lead.email

5 Syntax & Typos Correction

Clean data at the point of entry. Use the syntax validation tool to catch common keyboard slips and provide real-time feedback to users, ensuring valid emails are collected every time.

ruby
check = client.syntax.validate('[email protected]')
puts "Suggested: #{check.suggestion}" if check.suggestion # [email protected]

6 Rails Integration & Sidekiq

Built for the Rails ecosystem. The gem is thread-safe and perfectly suited for background processing with Sidekiq, Resque, or ActiveJob, keeping your user experience snappy and responsive.

ruby
class VerificationWorker
  include Sidekiq::Worker

  def perform(user_id)
    user = User.find(user_id)
    res = EmailVerify.client.verify(user.email)
    user.update(verified: res.valid?)
  end
end

7 Detailed Exception Handling

Implement safe failovers. Every API error is raised as a specific Ruby exception class, making it easy to catch and handle different failure modes without generic 'rescue Exception' blocks.

ruby
begin
  res = client.verify(email)
rescue EmailVerify::RateLimitError
  # Handle 429
rescue EmailVerify::AuthError
  # Handle invalid API key
rescue EmailVerify::NetworkError => e
  # Handle timeouts
end

8 Comprehensive Domain Intelligence

Uncover deeper insights. Beyond just valid/invalid, get detailed metadata about the recipient domain, including ESP identification and detection of professional vs. personal accounts.

ruby
res = client.verify('[email protected]')
puts "Is Catch-all: #{res.catch_all?}"
puts "Provider: #{res.provider_name}" # Google Workspace
puts "Is Disposable: #{res.disposable?}"
FAQs

Frequently Asked Questions

Question Icon

Is an API key required to use the Ruby SDK?

Yes, a valid API key from EmailVerify.io is required. You can obtain one by signing up for a free account on our platform.

Question Icon

Does the EmailVerify gem support Ruby on Rails?

Absolutely. The gem is fully compatible with Ruby on Rails. You can include it in your Gemfile and use it in models, controllers, or background jobs like Sidekiq.

Question Icon

How accurate is the Ruby SDK verification?

Our SDK provides 99%+ accuracy using real-time SMTP checks, MX record validation, and advanced disposable email detection algorithms.

Question Icon

Can I perform bulk verification with the Ruby SDK?

Yes, the SDK supports batch verification. You can submit lists of emails for background processing and check their status programmatically.

You're just one click away from clean email lists.

Start verifying your email addresses instantly and improve your campaign deliverability

* No credit card required