{"record":{"id":"f9fea2f799ba8ac8","repo":"RocketChat/Rocket.Chat","slug":"error-email-send-failed-f9fea2","errorCode":"error-email-send-failed","errorMessage":"Error trying to send email: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Error trying to send email: (.+?)","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/resetUserE2EKey.ts","lineNumber":47,"sourceCode":"\tconst html = `\n\t\t<p>${t('Your_e2e_key_has_been_reset')}</p>\n\t\t<p>${t('E2E_Reset_Email_Content')}</p>\n\t`;\n\n\tconst from = settings.get('From_Email');\n\tconst subject = t('E2E_key_reset_email');\n\n\tfor await (const address of addresses) {\n\t\ttry {\n\t\t\tawait Mailer.send({\n\t\t\t\tto: address,\n\t\t\t\tfrom,\n\t\t\t\tsubject,\n\t\t\t\ttext,\n\t\t\t\thtml,\n\t\t\t} as any);\n\t\t} catch (error) {\n\t\t\tthrow new Meteor.Error(\n\t\t\t\t'error-email-send-failed',\n\t\t\t\t`Error trying to send email: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t{\n\t\t\t\t\tfunction: 'resetUserE2EEncriptionKey',\n\t\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n};\n\nexport async function resetUserE2EEncriptionKey(uid: string, notifyUser: boolean): Promise<boolean> {\n\tif (notifyUser) {\n\t\tawait sendResetNotification(uid);\n\t}\n\n\tconst isUserFederated = await isUserIdFederated(uid);\n\tif (isUserFederated) {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/resetUserE2EKey.ts#L29-L65","documentation":"Meteor.Error('error-email-send-failed') wrapping the underlying error from Mailer.send while delivering the 'E2E_key_reset_email' notification. The original transport message is preserved in both the error reason and details ({ function: 'resetUserE2EEncriptionKey', message }).","triggerScenarios":"resetUserE2EEncriptionKey(uid, true) when the SMTP send fails: unreachable host, wrong port, rejected credentials, or TLS errors while sending to one of the user's verified addresses.","commonSituations":"Development environments without SMTP; rotated/expired SMTP credentials; mail provider throttling or quota; firewall/DNS blocking outbound SMTP.","solutions":["Open Administration > Email and use the test-email action to reproduce the SMTP failure directly.","Fix host/port/username/password/TLS per your provider and retry the reset.","Read the wrapped message in error.details.message for the exact SMTP cause.","If email notification is not required for your flow, call the reset with notifyUser=false."],"exampleFix":"// before\nawait resetUserE2EEncriptionKey(uid, true); // SMTP problems abort the whole reset\n\n// after: decouple the reset from email delivery\nawait resetUserE2EEncriptionKey(uid, false);\n// send the notification separately with its own retry logic","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await resetUserE2EEncriptionKey(uid, true);\n} catch (error: any) {\n  if (error?.error === 'error-email-send-failed') {\n    // error.details.message holds the SMTP cause; fix mail settings and retry\n  }\n}","preventionTips":["Validate SMTP settings with the admin test-email action before triggering resets that email users.","Monitor SMTP credential expiry and provider quotas.","If email is optional for your flow, call resetUserE2EEncriptionKey(uid, false)."],"tags":["email","smtp","e2e-encryption","mailer"],"backgroundTag":"email-send-failed","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}