SocketLabs for Simple Senders
Everything you need to start directly sending email for yourself or your company
SocketLabs for Complex Senders
You’re an email provider, marketing platform, or brand with multiple business units.
You get everything above, plus.....
SocketLabs for On Premises Senders
Everything your business needs for an on-premises solution

The SocketLabs Email Delivery Ruby library allows you to easily send any type of email message supported by our Injection API, from a simple message to a single recipient, to a complex bulk message sent to multiple recipients.

Send Bulk Email Without Having to Build & Maintain Your Own SMTP Email Servers

Basic Message

A basic message is an email message like you’d send from a personal email client such as Outlook. A basic message can have many recipients, including multiple, To Addresses, CC Addresses, and even BCC Addresses. You can also send a file attachment in a basic message.

require "socketlabs-injectionapi"
include SocketLabs::InjectionApi
include SocketLabs::InjectionApi::Message
message =
message.subject = "Sending A Basic Message"
message.html_body = "This is the Html Body of my message."
message.plain_text_body = "This is the Plain Text Body of my message."
message.from_email_address ="[email protected]")
# Add a To address by passing the email address
message.to_email_address.push("[email protected]")
# Your SocketLabs ServerId and Injection API key
client =, "YOUR-API-KEY")
response = client.send(message)


Bulk Message

A bulk message usually contains a single recipient per message and is generally used to send the same content to many recipients, optionally customizing the message via the use of MergeData.

require "socketlabs-injectionapi"
include SocketLabs::InjectionApi
include SocketLabs::InjectionApi::Message
# Your SocketLabs ServerId and Injection API key
client =, "YOUR-API-KEY")
message =
message.subject = "Sending A Bulk Message"
message.plain_text_body = "This is the body of my message sent to %%Name%%"
message.html_body = "This is the HtmlBody of my message sent to %%Name%%"
message.from_email_address ="[email protected]")
message.add_global_merge_data("HairColor", "{ not set }")
recipient1 ="[email protected]")
recipient1.add_merge_data("Name", "Recipient1")
recipient2 ="[email protected]", { :friendly_name => "Recipient #2" })
recipient2.add_merge_data("Name", "Recipient2")
response = client.send(message)


How to Get Started

To run these samples you will need to obtain an API Key and ServerId number from your SocketLabs Control Panel.

I Don’t Have a SocketLabs Account

Create Your Account

I Have a SocketLabs Account

Get Your API Key and Server ID

About Our Code Libraries

SocketLabs’ email API plays well with your favorite platforms and development frameworks, including .NET, PHP, Java, Node.js, Python, Go, and more! As a developer, our APIs for sending email give you all the tools you need to embed powerful email functionality into your applications.

SocketLabs  Developers


SocketLabs is built for developers, by developers.


Reach the inbox with industry-leading deliverability.

Integrate with your application in minutes.

Looking for More Libraries & Code Samples?

Speed up development with pre-built libraries and code samples for popular languages. Choose a library below!