Trying Out Resend's Free Email Sending Service
Email is such a hassle, isn’t it?
Many IaaS providers block port 25 from VMs to the internet, and if you want to send emails from your own VM, you first have to apply to get it opened.
Even if that’s approved, you then have to set up DKIM and SPF, and even if those are okay, emails might still not arrive.
Recently, the pattern of directly sending emails from your own server has significantly decreased, and it’s now mostly done using managed services from cloud providers.
Good Points of Resend
The three main advantages of the email sending service Resend are as follows:
- There is a free quota
- You can send emails via HTTP API
- Official libraries are provided for major languages (of course, Ruby too!)
The following is a comparison table of major email services.
Resend has a smaller free usage quota compared to Brevo and Mailjet, but the fact that it can be handled via HTTP API is significant.
| Service | Free Email Quota | Main Limitations & Notes | Suitable Use Cases |
|---|---|---|---|
| Brevo | 300 emails/day | No carry-over of unused quotas. Transactional emails available even on free plans | Small production environments, notification emails, combined newsletters |
| Mailjet | 6,000 emails/month, 200 emails/day | 1,000 contacts. API, SMTP Relay, Webhook available | Small services that need to ensure monthly email volume |
| Resend | 3,000 emails/month, 100 emails/day | Free quota is 1 domain. REST API, SMTP, official SDK support. Sent and received emails count toward the quota | Modern web development such as Next.js, Node.js |
| Elastic Email | 3,000 emails/month, 100 emails/day | Email API/SMTP support. No card required at start | Transactional emails centered on API |
| Mailgun | 100 emails/day | 1 custom domain, 1 day log retention, 2 API keys. No card required | Development and testing, small API sending |
| SMTP2GO | 1,000 emails/month, 200 emails/day | 25 emails/hour if domain not verified. 5 days report retention | Existing systems using SMTP, multifunction devices, servers |
| MailerSend | 500 emails/month, 100 emails/day | Available after account approval. Card information required even on free plans | Small application notifications, development environments |
| Postmark | 100 emails/month | Developer plan. No expiration but effectively for development and testing | Pre-testing systems that prioritize delivery quality |
Personally, I think point 2, the HTTP API, is particularly significant.
As mentioned earlier, in cloud environments, email sending ports are often blocked, and I’ve long wanted to send emails via HTTP API.
Also, having a free quota is simply pleasant.
For someone like me who only needs to send a few emails, such as when a comment is added to a blog, it’s very helpful.
Email Sending in Ruby on Rails
The simplest way to send emails with Ruby is as follows
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Hello World",
"html": "<strong>it works!</strong>"
}
sent = Resend::Emails.send(params)
puts sent
It’s a very simple setup.
In Rails, it can be integrated with Action Mailer.
# Add this to config/initializers/mailer.rb:
Resend.api_key = "re_xxxxxxxxx"
# Add this to config/environments/environment.rb:
config.action_mailer.delivery_method = :resend
# Send the email
class UserMailer < ApplicationMailer
default from: '[email protected]'
def welcome_email
@user = params[:user]
@url = 'http://example.com/login'
mail(to: ["[email protected]"], subject: 'Hello World')
end
end
This is ideal for me.
I’m already using it on this blog. If it works well, I’ll consider a paid contract for other systems.
Comments
No comments yet.