Skip to content

Add SMTP support as an alternative email provider #153

@ntuan2502

Description

@ntuan2502

Problem statement

Currently, Reqcore relies on RESEND_API_KEY for sending emails.

This creates several limitations:

  • Requires dependency on a third-party email service (Resend)
  • Not suitable for organizations that already have existing SMTP infrastructure
  • Adds extra cost and external dependency
  • Reduces flexibility for self-hosted deployments
  • Some environments (enterprise / on-premise) restrict use of external APIs

For teams running Reqcore in production, especially self-hosted setups, this is a significant limitation.

Proposed solution

Add support for SMTP-based email sending as an alternative to RESEND_API_KEY.

Specifically:

Allow configuration via environment variables such as:

SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASS=
SMTP_FROM=
SMTP_SECURE=true

Application behavior:

  • If SMTP config is provided → use SMTP for sending emails
  • Otherwise → fallback to existing Resend integration

Suggested implementation:

  • Use a standard library (e.g. Nodemailer)
  • Abstract email provider behind a service layer
  • Support both providers (Resend + SMTP)

Optional improvements:

  • Support TLS / STARTTLS
  • Support custom sender name
  • Add connection test endpoint or health check
  • Support multiple email providers via adapter pattern

Alternatives considered

  • Continue using only Resend
    → Simple but limits flexibility and self-hosting

  • Replace Resend entirely with SMTP
    → Not ideal, removes existing working integration

  • Use other API providers (SendGrid, Mailgun, etc.)
    → Still external dependency, same limitation as Resend

Scope and impact

This improvement benefits:

  • Self-hosted users → full control over email infrastructure
  • Enterprises → easier compliance with internal policies
  • Developers → more flexibility in configuration
  • DevOps teams → easier integration with existing systems

Success can be measured by:

  • Increased adoption in self-hosted environments
  • Reduced issues related to email setup
  • More flexible deployment configurations

Checklist

  • I searched existing issues and did not find a duplicate.
  • This request aligns with Reqcore's ownership/transparency/privacy direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions