Skip to content

Bug: Registration fails with "Failed to send verification email" - Missing email service configuration #211

Description

@aarushii25
Image ## 🐛 Bug Report

Describe the bug
When a new user tries to register on Eduboard locally, the signup fails with the error:

"Failed to send verification email. Please check your email and try again."

The user is deleted from the database and registration never completes.

🔍 Root Cause

The server .env file has no email service credentials configured:

  • EMAIL_USER is missing
  • EMAIL_PASS is missing
  • SMTP_HOST / EMAIL_SERVICE is missing

The emailService.js has no fallback when these variables are absent, causing sendRegistrationVerificationEmail() to fail silently and return { success: false }.

✅ Expected Behavior

  • Either registration should succeed with a clear message like "Email service not configured, please set up SMTP credentials"
  • Or a .env.example in the server/ folder should document the required email variables so contributors can set them up locally.

💡 Proposed Fix

  1. Add email credentials to server/.env.example:
  2. Add a graceful fallback in emailService.js when credentials are missing — log the OTP to console in development mode so local testing still works.

🖥️ Environment

  • OS: Windows 11
  • Node version: (run node -v)
  • npm version: (run npm -v)

📁 Affected Files

  • server/services/emailService.js
  • server/.env.example
    @KENZY004 pls assign me the issue under gssoc 2026

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions