{"record":{"id":"eae5e9d2f52eb663","repo":"appsmithorg/appsmith","slug":"failed-to-send-error-mail-email-provider-is-not-c","errorCode":null,"errorMessage":"Failed to send error mail. Email provider is not configured, please refer to https://docs.appsmith.com/setup/instance-configuration/email to configure it.","messagePattern":"Failed to send error mail\\. Email provider is not configured, please refer to https://docs\\.appsmith\\.com/setup/instance-configuration/email to configure it\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"app/client/packages/rts/src/ctl/mailer.ts","lineNumber":25,"sourceCode":"  const mailEnabled = process.env.APPSMITH_MAIL_ENABLED;\n  const mailFrom = process.env.APPSMITH_MAIL_FROM;\n  const mailHost = process.env.APPSMITH_MAIL_HOST;\n  const mailPort = process.env.APPSMITH_MAIL_PORT;\n  const mailUser = process.env.APPSMITH_MAIL_USERNAME;\n  const mailPass = process.env.APPSMITH_MAIL_PASSWORD;\n  const mailTo = process.env.APPSMITH_ADMIN_EMAILS;\n\n  console.log(\"Sending Error mail to admins.\");\n  try {\n    if (\n      !mailEnabled ||\n      !mailFrom ||\n      !mailHost ||\n      !mailPort ||\n      !mailUser ||\n      !mailPass\n    ) {\n      throw new Error(\n        \"Failed to send error mail. Email provider is not configured, please refer to https://docs.appsmith.com/setup/instance-configuration/email to configure it.\",\n      );\n    } else if (!mailTo) {\n      throw new Error(\n        \"Failed to send error mail. Admin email(s) not configured, please refer to https://docs.appsmith.com/setup/instance-configuration/disable-user-signup#administrator-emails to configure it.\",\n      );\n    } else if (!mailEnabled) {\n      throw new Error(\n        \"Mail not sent! APPSMITH_MAIL_ENABLED env val is disabled, please refer to https://docs.appsmith.com/setup/instance-configuration/email to enable it.\",\n      );\n    } else {\n      const backupFiles = await utils.listLocalBackupFiles();\n      const lastBackupfile = backupFiles.pop();\n      const lastBackupTimestamp = lastBackupfile.match(\n        /appsmith-backup-(.*)\\.tar.gz/,\n      )[1];\n      const lastBackupPath = Constants.BACKUP_PATH + \"/\" + lastBackupfile;\n","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/client/packages/rts/src/ctl/mailer.ts#L7-L43","documentation":"Thrown by sendBackupErrorToAdmins() in mailer.ts. It reads six APPSMITH_MAIL_* vars (ENABLED, FROM, HOST, PORT, USERNAME, PASSWORD); if ANY is falsy it throws this message, because without a fully configured SMTP provider the error-notification email cannot be sent. Note this is the first (broadest) of three mail branches.","triggerScenarios":"A backup fails and the RTS tries to email admins, but one or more of APPSMITH_MAIL_ENABLED/FROM/HOST/PORT/USERNAME/PASSWORD is unset or empty in the environment.","commonSituations":"Fresh install where email was never configured; partial config (HOST set but PORT missing); secret-injection system (Docker secret/K8s secret) that failed to populate APPSMITH_MAIL_PASSWORD; APPSMITH_MAIL_ENABLED set to a falsy string.","solutions":["Set all six vars in /appsmith-stacks/runtime.env (or container env): APPSMITH_MAIL_ENABLED=true plus FROM, HOST, PORT, USERNAME, PASSWORD.","Reload the env / restart the RTS process so the new values are read.","Use a transactional SMTP provider (Mailgun/SES/SendGrid) credentials and confirm PORT matches TLS (465/587).","Validate by sending a test mail via the Appsmith admin settings UI, which exercises the same config."],"exampleFix":"# before\nAPPSMITH_MAIL_ENABLED=true\nAPPSMITH_MAIL_HOST=smtp.example.com\n# (PORT / USERNAME / PASSWORD missing)\n\n# after\nAPPSMITH_MAIL_ENABLED=true\nAPPSMITH_MAIL_FROM=noreply@example.com\nAPPSMITH_MAIL_HOST=smtp.example.com\nAPPSMITH_MAIL_PORT=587\nAPPSMITH_MAIL_USERNAME=postmaster@example.com\nAPPSMITH_MAIL_PASSWORD=********","handlingStrategy":"validation","validationCode":"const required = ['APPSMITH_MAIL_ENABLED','APPSMITH_MAIL_FROM','APPSMITH_MAIL_HOST','APPSMITH_MAIL_PORT','APPSMITH_MAIL_USERNAME','APPSMITH_MAIL_PASSWORD'];\nconst missing = required.filter(k => !process.env[k]);\nif (missing.length) throw new Error(`Missing mail config: ${missing.join(', ')}`);","typeGuard":"const isMailConfigured = (env: NodeJS.ProcessEnv): boolean =>\n  Boolean(env.APPSMITH_MAIL_ENABLED && env.APPSMITH_MAIL_FROM && env.APPSMITH_MAIL_HOST && env.APPSMITH_MAIL_PORT && env.APPSMITH_MAIL_USERNAME && env.APPSMITH_MAIL_PASSWORD);","tryCatchPattern":"try { await sendBackupErrorToAdmins(err, ts); } catch (e) {\n  if (/Email provider is not configured/i.test(e.message)) { log.warn('Skipping admin mail: SMTP not configured'); }\n  else throw e;\n}","preventionTips":["Configure all six mail vars in runtime.env at install time.","Use the admin settings UI to validate SMTP end-to-end.","Treat a missing mail config as a warning, not a fatal backup failure."],"tags":["email","smtp","configuration","environment-variables","operations"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}