[bug]: test email not sending while setting up SMTP
@vihar is already working on this.
Since Jul 24, 2026.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
When setting up SMTP for the first time under Instance Admin (God Mode) → Settings → Email, if you fill in the SMTP fields and click "Send test email" without clicking "Save Changes" first, the request fails with a 500 error instead of a validation message.
Backend log shows:
ValueError: invalid literal for int() with base 10: ''
at plane/license/api/views/configuration.py, line 110, in post
port=int(EMAIL_PORT)
The test-email endpoint (/api/instances/email-credentials-check/) appears to be reading EMAIL_PORT (and presumably the other SMTP fields) from the last saved instance configuration rather than the values currently typed into the form. Since nothing had been saved yet, EMAIL_PORT was an empty string, and int('') threw an unhandled ValueError, causing a 500.
What I expected: either the test should validate against the unsaved form values (so first-time setup works without a separate save step), or if it's intentional that test-email only works against saved config, the UI should block the test / show a clear "please save your settings first" message instead of silently failing with a 500.
Steps to reproduce
- Go to Instance Admin (God Mode) → Settings → Email on a fresh instance with no email config saved yet.
- Fill in SMTP Host, Username, Password, Port, and Sender Email.
- Without clicking "Save Changes", click "Send test email".
- Request to POST /api/instances/email-credentials-check/ returns 500.
- Backend logs show ValueError: invalid literal for int() with base 10: '' at configuration.py line 110.
- Click "Save Changes", then click "Send test email" again — this time it succeeds.
Environment
Production
Browser
Google Chrome
Variant
Self-hosted
Version
v1.3.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.