For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/examples/smtp/ruby.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

Ruby

Send emails via Reloop SMTP using net/smtp in Ruby.

Ruby SMTP Integration

You can send emails through Reloop using Ruby's standard net/smtp library.

View complete runnable example on GitHub ↗

Code Example

require 'net/smtp'
require 'openssl'

api_key = ENV['RELOOP_API_KEY']

message = <<MESSAGE_END
From: onboarding@reloop.sh
To: delivered@resend.dev
MIME-Version: 1.0
Content-type: text/html
Subject: Hello from Ruby net/smtp

<p>Congrats on sending your first email via Reloop SMTP using net/smtp!</p>
MESSAGE_END

begin
  Net::SMTP.start('smtp.reloop.sh', 587, 'localhost', api_key, api_key, :plain) do |smtp|
    smtp.send_message message, 'onboarding@reloop.sh', 'delivered@resend.dev'
  end
  puts "Email sent successfully!"
rescue => e
  puts "Error: #{e.message}"
end

Was this page helpful?

Edit this page