Email API Integration Guide with Ruby on Rails

Minimum code that you need to integrate Mailazy with your Ruby on Rails application


You need to complete these given prerequisites, you can skip the step if you have already completed.

  1. Sign up for a Mailazy account.
  2. Complete Domain Authentication.
  3. Generate the Mailazy Access Key

Integrate Mailazy with Ruby on Rails

Start Sending mail using the code provided below:

require "uri"
require "net/http"
url = URI("")
https =, url.port);
https.use_ssl = true
request =
request["X-Api-Key"] = "<API KEY>"
request["X-Api-Secret"] = "<API SECRET>"
request["Content-Type"] = "application/json"
request.body = '{
      "to": [""],
      "from": "Sender <>",
      "subject": "<Subject>",
      "content": [{"type": "text/plain","value": "<Content>"}]
response = https.request(request)
puts response.read_body