Mail Server (SMTP) Configuration
To send email from Bellamy Book (password reset, notifications, contact form, etc.), configure an SMTP server in your .env.
Step 1: Get SMTP credentials
Gmail (quick option):
- Sign in at Google Account.
- Enable 2-Step Verification if you have not already.
- Go to App Passwords. Create an app password for “Mail” (or “Other”) and copy the 16-character value. Use this as
Smtp__Pass; do not use your normal Google password.
Other providers (SendGrid, Mailgun, Amazon SES, etc.):
- Sign up at the provider ’s site, create an SMTP user or API key, and note the host, port, username, and password they give you. Use those in the variables below.
Step 2: Set environment variables
In your .env, set:
| Variable | Example | Description |
|---|---|---|
Smtp__Server | smtp.gmail.com | SMTP server hostname. |
Smtp__Port | 587 | Usually 587 (TLS) or 465 (SSL). |
Smtp__User | [email protected] | SMTP username (often your email). |
Smtp__Pass | your-app-password | SMTP password or app password. |
Smtp__DefaultFrom | Bellamy Book <[email protected]> | "From" name and address for outgoing mail. |
Example (Gmail)
Smtp__Server=smtp.gmail.com
Smtp__Port=587
Smtp__Pass=xxxx-xxxx-xxxx-xxxx
Smtp__DefaultFrom=Bellamy Book <[email protected]>
- Enable 2FA on your Google account.
- Go to Google App Passwords, create an app password for "Mail", and use that 16-character value as
Smtp__Pass.
Example (SendGrid / other)
Use the SMTP host and credentials from your provider (e.g. smtp.sendgrid.net, port 587).
Step 3: Restart the API
After changing .env, restart the backend so it picks up the new values:
docker compose restart api
Troubleshooting
| Issue | What to check |
|---|---|
| Emails not sending | Verify Smtp__Server, Smtp__Port, Smtp__User, Smtp__Pass. Check API logs: docker compose logs api. |
| Gmail "Less secure app" / blocked | Use an App Password, not your normal password. |
| Wrong "From" address | Set Smtp__DefaultFrom to a valid address (some providers require a verified domain). |
Next steps
- Environment Configuration — Full list of variables
- Troubleshooting — General issues