Turn Docker container into a functional SMTP server that relays all emails via Resend
1.3K
This image is NOT officially supported by Resend.
Turn your Docker container into a functional SMTP server that relays all emails via Resend — a trusted email API service. Ideal for self-hosted applications that need reliable email delivery without landing in the junk box.
This container runs a lightweight SMTP server (based on aiosmtpd) that accepts incoming mail and forwards it using the Resend API.
If you're tired of your app's emails going to spam (especially on Gmail), using a trusted service like Resend improves your chances of reaching the inbox.
Sign up at Resend and generate an API key.
Set the RESEND_API_KEY environment variable in your Docker environment.
Run the container using docker-compose or docker run.
services:
smtp2resend:
container_name: smtp2resend
image: hsiaoshun/smtp2resend:latest
restart: unless-stopped
ports:
- 25:25
environment:
- RESEND_API_KEY=${RESEND_API_KEY} # Replace with your actual Resend API key
Example of using it with bookstack(please make sure bookstatck and smtp2resend is in the same network):
bookstack-internal:
image: solidnerd/bookstack:25.5.1
container_name: bookstack-internal
depends_on:
- bookstack-mysql
restart: unless-stopped
environment:
...
- MAIL_HOST=smtp2resend # or replace it to your IP
- MAIL_USERNAME=
- MAIL_PASSWORD=
- MAIL_PORT=25
- [email protected] # your FROM address
- MAIL_FROM_NAME=no-reply # your FROM name
...
While using Resend can significantly increase the chances of your emails being delivered to the inbox (especially for major providers like Gmail), delivery is not guaranteed.
Inbox placement depends on various factors including:
your From domain's DNS configuration (SPF, DKIM, DMARC),
message content quality.
recipient behavior.
email sending volume.
This container does not modify or optimize deliverability headers beyond what Resend provides.
Only supports unauthenticated SMTP on port 25 (ideal for internal use).
All emails are forwarded using the resend.Emails.send() API.
Supports To and Cc addresses correctly.
Handles UTF-8 encoded subjects and HTML or plain text bodies.
Content type
Image
Digest
sha256:1e408c3db…
Size
51.2 MB
Last updated
about 1 year ago
docker pull hsiaoshun/smtp2resend