Skip to content

Commit 8229720

Browse files
committed
doc: added description for SMTP
1 parent 6a586df commit 8229720

3 files changed

Lines changed: 166 additions & 59 deletions

File tree

apps/public/content/docs/self-hosting/environment-variables.mdx

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,81 @@ Get your API key from [resend.com](https://resend.com). Make sure to verify your
324324
**Required**: No
325325
**Default**: `hello@openpanel.dev`
326326

327-
Email address used as the sender for transactional emails.
327+
Email address used as the sender for transactional emails. Applies to both Resend and SMTP transports.
328328

329329
**Example**:
330330
```bash
331331
EMAIL_SENDER=noreply@yourdomain.com
332332
```
333333

334+
### SMTP_HOST
335+
336+
**Type**: `string`
337+
**Required**: No
338+
**Default**: None
339+
340+
SMTP server hostname. When set, OpenPanel uses SMTP to send emails instead of Resend. Takes priority over `RESEND_API_KEY` if both are configured.
341+
342+
**Example**:
343+
```bash
344+
SMTP_HOST=smtp.example.com
345+
```
346+
347+
### SMTP_PORT
348+
349+
**Type**: `number`
350+
**Required**: No
351+
**Default**: `587`
352+
353+
SMTP server port.
354+
355+
**Example**:
356+
```bash
357+
SMTP_PORT=587
358+
```
359+
360+
### SMTP_SECURE
361+
362+
**Type**: `boolean`
363+
**Required**: No
364+
**Default**: `false`
365+
366+
Use TLS for the SMTP connection. Set to `true` when using port `465`.
367+
368+
**Example**:
369+
```bash
370+
SMTP_SECURE=true
371+
```
372+
373+
### SMTP_USER
374+
375+
**Type**: `string`
376+
**Required**: No
377+
**Default**: None
378+
379+
SMTP authentication username. Leave unset if your server does not require authentication.
380+
381+
**Example**:
382+
```bash
383+
SMTP_USER=smtp-user@example.com
384+
```
385+
386+
### SMTP_PASS
387+
388+
**Type**: `string`
389+
**Required**: No
390+
**Default**: None
391+
392+
SMTP authentication password.
393+
394+
**Example**:
395+
```bash
396+
SMTP_PASS=your-smtp-password
397+
```
398+
334399
<Callout>
335-
The sender email must be verified in your Resend account.
400+
Set `SMTP_HOST` to enable SMTP. If both `SMTP_HOST` and `RESEND_API_KEY` are present, SMTP takes priority. If neither is set, emails are logged to the console (useful for development).
401+
In case of using Resend, the sender email must be verified in your Resend account.
336402
</Callout>
337403

338404
## OAuth & Integrations
@@ -834,7 +900,7 @@ For a basic self-hosted installation, these variables are required:
834900

835901
### Optional but Recommended
836902

837-
- `RESEND_API_KEY` - For email features
903+
- `RESEND_API_KEY` or `SMTP_HOST` - For email features (pick one)
838904
- `EMAIL_SENDER` - Email sender address
839905
- `OPENAI_API_KEY` and/or `ANTHROPIC_API_KEY` - For the in-app AI chat assistant
840906

apps/public/content/docs/self-hosting/self-hosting.mdx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const op = new OpenPanel({
102102

103103
### E-mail
104104

105-
Some of OpenPanel's features require e-mail. We use Resend as our transactional e-mail provider. To enable email features, create an account on Resend and set the `RESEND_API_KEY` environment variable.
105+
Some of OpenPanel's features require e-mail. We use Resend as our transactional e-mail provider by default, but you can also use your own SMTP server. To enable email features, set the relevant environment variables described below.
106106

107107
<Callout>This is nothing that is required for the basic setup, but it is required for some features.</Callout>
108108

@@ -112,6 +112,32 @@ Features that require e-mail:
112112
- Invitations
113113
- more will be added over time
114114

115+
#### Option A — Resend
116+
117+
Create an account on [resend.com](https://resend.com), verify your sender domain, and set the `RESEND_API_KEY` environment variable.
118+
119+
```bash title=".env"
120+
RESEND_API_KEY=re_xxxxxxxxxxxxx
121+
EMAIL_SENDER=noreply@yourdomain.com
122+
```
123+
124+
#### Option B — SMTP
125+
126+
If you prefer to use your own SMTP server, set `SMTP_HOST` and OpenPanel will use it instead of Resend.
127+
128+
```bash title=".env"
129+
SMTP_HOST=smtp.example.com
130+
SMTP_PORT=587
131+
SMTP_SECURE=false
132+
SMTP_USER=smtp-user@example.com
133+
SMTP_PASS=your-smtp-password
134+
EMAIL_SENDER=noreply@yourdomain.com
135+
```
136+
137+
<Callout type="info">
138+
`SMTP_HOST` takes priority over `RESEND_API_KEY` if both are set. If neither is configured, emails are logged to the console instead of being sent.
139+
</Callout>
140+
115141
For email configuration details, see the [Environment Variables documentation](/docs/self-hosting/environment-variables#email).
116142

117143
### AI integration

0 commit comments

Comments
 (0)