{"record":{"id":"e483721e50c9d7b9","repo":"RocketChat/Rocket.Chat","slug":"error-email-send-failed-e48372","errorCode":"error-email-send-failed","errorMessage":"SMTP is not configured","messagePattern":"SMTP is not configured","errorType":"exception","errorClass":"MeteorError","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/api/v1/users.ts","lineNumber":853,"sourceCode":"\t\tpermissionsRequired: ['send-mail'],\n\t\tresponse: {\n\t\t\t200: ajv.compile<void>({\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tsuccess: { type: 'boolean', enum: [true] },\n\t\t\t\t},\n\t\t\t\trequired: ['success'],\n\t\t\t\tadditionalProperties: false,\n\t\t\t}),\n\t\t\t400: validateBadRequestErrorResponse,\n\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t},\n\t},\n\tasync function action() {\n\t\tconst { email } = this.bodyParams;\n\n\t\tif (!isSMTPConfigured()) {\n\t\t\tthrow new MeteorError('error-email-send-failed', 'SMTP is not configured', {\n\t\t\t\tmethod: 'sendWelcomeEmail',\n\t\t\t});\n\t\t}\n\n\t\tconst user = await Users.findOneByEmailAddress(email.trim(), { projection: { name: 1 } });\n\n\t\tif (!user) {\n\t\t\tthrow new MeteorError('error-invalid-user', 'Invalid user', {\n\t\t\t\tmethod: 'sendWelcomeEmail',\n\t\t\t});\n\t\t}\n\n\t\tawait sendWelcomeEmail({ ...user, email });\n\n\t\treturn API.v1.success();\n\t},\n);\n","sourceCodeStart":835,"sourceCodeEnd":871,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/users.ts#L835-L871","documentation":"Thrown by users.sendWelcomeEmail when isSMTPConfigured() is false. The endpoint cannot send mail because no SMTP server is configured, so it fails fast rather than silently dropping the welcome email.","triggerScenarios":"POST users.sendWelcomeEmail before Email / SMTP settings have been populated (host, port, credentials).","commonSituations":"Fresh install without email setup; SMTP settings cleared during migration; environment-specific config not applied.","solutions":["Configure SMTP (Admin > Email > SMTP) with a valid host/port/user/pass, then retry.","Verify connectivity from the server to the SMTP host (firewall, DNS, credentials).","Use the 'Send a test email' admin action to confirm SMTP works before calling the endpoint."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Check SMTP readiness via admin settings before offering the action\nconst smtp = await GET('settings.smtp');\nif (!smtp || !smtp.host) { showSMTPWarning(); return; }","typeGuard":"null","tryCatchPattern":"try {\n  await POST('users.sendWelcomeEmail', { email });\n} catch (e) {\n  if (isMeteorError(e, 'error-email-send-failed')) {\n    // prompt admin to configure SMTP, then retry\n  } else { throw e; }\n}","preventionTips":["Configure and test SMTP during workspace provisioning.","Use the admin 'test email' before invoking sendWelcomeEmail."],"tags":["email","smtp","configuration","api","users"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}