Skip to content

Fix email verification using Resend API instead of SMTP#78

Merged
Panther114 merged 1 commit into
mainfrom
railway/code-change-cMLmkz
May 27, 2026
Merged

Fix email verification using Resend API instead of SMTP#78
Panther114 merged 1 commit into
mainfrom
railway/code-change-cMLmkz

Conversation

@railway-app

@railway-app railway-app Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Problem

Email verification was failing with ETIMEDOUT errors because Railway's Singapore region cannot reliably reach smtp.resend.com on port 587. The Nodemailer SMTP transport was the primary delivery path, and the existing partial Resend fallback still used a raw fetch call rather than the official SDK.

Solution

Replaced Nodemailer SMTP entirely with the resend npm SDK (resend@^4.0.0). The resendClient is initialised once at startup with comprehensive logging (ready state, sender address, init errors). sendVerificationEmail now uses resendClient.emails.send() exclusively, logging the recipient, elapsed time, Resend message ID on success, and full error details on failure. isEmailConfigured() now checks only RESEND_API_KEY. The old SMTP_HOST/PORT/USER/PASS/SECURE constants and SmtpNotConfiguredError class are removed; route handlers now reference the new EmailNotConfiguredError. SMTP_FROM is retained as the sender address env var for backward compatibility.

Changes

  • Modified package.json
  • Modified server.js

Generated by Railway

@Panther114 Panther114 merged commit 349ae74 into main May 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant