Skip to content
This repository
branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 Rakefile
Octocat-spinner-32 smtpcom_api.gemspec


SmtpcomApi is a ruby wrapper for the API (


[sudo] gem install smtpcom_api



You need api key and api url for authentication in SmtpcomApi

client ='your_api_key', 'api_url')

Account settings

Getting account

account = client.account

Getting account attributes as hash

# or

Updating account attributes:

account.company_name = 'My Company'


Getting senders list

senders = client.senders 
# or 
senders = account.senders

Finding one sender by his label or id

sender = client.sender('sender_label_or_id') 
# or
sender = account.sender('sender_label_or_id')

Getting sender attributes as hash

# or 

Updating sender attributes

sender.login    = 'new_login'
sender.password = 'new_password1'

Adding new sender

attributes = { 
  :label      => 'my_label', 
  :login      => 'my_login', 
  :password   => 'my_password1',
  :max_quota  => 10000
new_sender = client.add_sender attributes

Some senders could be authenticated by IP address instead of login/pass To allow sender login that way you should set :is_ip_based attribute to true and add allowed IPs

# setting is_ip_based = true
new_sender.is_ip_based = true

# adding allowed IPs

# or removing some


Examples how to get sender statistics data (summary/detailed delivery/campaigns/complaints/queue):

now       =
month_ago = now - 30*24*60*60

sender.summary :time_start => month_ago, :time_end => now :time_start => month_ago, :time_end => now, :limit => 10, :offset => 0
sender.campaigns :time_start => month_ago, :time_end => now
sender.complaints :time_start => month_ago, :time_end => now, :limit => 10, :offset => 0
sender.queue :time_start => month_ago, :time_end => now, :limit => 10, :offset => 0

Contributing to smtpcom_api

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright (c) 2012 Vasiliy Sablin. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.