{"record":{"id":"d5eb149cc0ec7f48","repo":"appwrite/appwrite","slug":"project-smtp-config-invalid","errorCode":"project_smtp_config_invalid","errorMessage":"$error->getMessage()","messagePattern":"\\$error->getMessage\\(\\)","errorType":"exception","errorClass":"Appwrite\\Extend\\Exception","httpStatus":400,"severity":"error","filePath":"src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php","lineNumber":167,"sourceCode":"                \\gethostname() ?: 'localhost',\n                $credentials,\n                $encryption,\n                new Timeouts(connect: 5.0, read: 5.0, write: 5.0),\n            );\n\n            try {\n                // Nothing is dialled until a session is needed, so asking what\n                // the server offers is what greets, upgrades and authenticates.\n                $client->capabilities();\n\n                // Auto-enable if configuration is valid\n                // Dont do this if specifically request to mark disabled\n                if (\\is_null($enabled)) {\n                    $smtp['enabled'] = true;\n                }\n            } catch (Throwable $error) {\n                if (($smtp['enabled'] ?? null) === true) {\n                    throw new Exception(Exception::PROJECT_SMTP_CONFIG_INVALID, $error->getMessage());\n                }\n            } finally {\n                $client->close();\n            }\n        }\n\n        // Save configuration\n        $updates = new Document([\n            'smtp' => $smtp,\n        ]);\n\n        $project = $authorization->skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $updates));\n        $authorization->skip(fn () => $dbForPlatform->purgeCachedDocument('projects', $project->getId()));\n\n        $response->dynamic($project, Response::MODEL_PROJECT);\n    }\n}\n","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/appwrite/appwrite/blob/feb9831e60c12102a2c75891715c7401d0f9a89c/src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php#L149-L185","documentation":"Error \"$error->getMessage()\" thrown in appwrite/appwrite.","triggerScenarios":"Thrown at src/Appwrite/Platform/Modules/Project/Http/Project/SMTP/Update.php:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the mail error details in the server logs and fix the SMTP configuration.","Verify SMTP host, port, credentials, and TLS settings, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"feb9831e60c12102a2c75891715c7401d0f9a89c","analyzedAt":"2026-08-18T21:34:56.994Z","contentChangedAt":"2026-08-18T21:34:56.994Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}