Email (SMTP) โ
Send HTML notifications via any SMTP server. Email supports multi-recipient delivery and per-user notifications for login and account events.
Overview โ
- ๐ง Universal โ Works with any SMTP server
- ๐จ HTML Templates โ Color-coded status bar with structured fields
- ๐ฅ Multiple Recipients โ Send to one or more email addresses
- ๐ Secure Transport โ SSL, STARTTLS, or plain connections
- ๐ค Per-User Delivery โ Direct emails to affected users for auth events
Configuration โ
| Field | Description | Default | Required |
|---|---|---|---|
| SMTP Host | Mail server hostname | โ | โ |
| Port | SMTP port | 587 | โ |
| Security | None, SSL, or STARTTLS | starttls | โ |
| User | SMTP username | โ | โ |
| Password | SMTP password | โ | โ |
| From | Sender email address | โ | โ |
| To | Recipient email address(es) | โ | โ |
Setup Guide โ
1. Gather SMTP Details โ
You'll need the following from your email provider:
- SMTP server hostname and port
- Authentication credentials (if required)
- Security method (SSL, STARTTLS, or none)
2. Configure in DBackup โ
- Go to Notifications in the sidebar
- Click Add Notification
- Select Email (SMTP)
- Fill in the SMTP connection details
- Set the sender (From) and recipient (To) addresses
- Click Test to send a test email
- Save
3. Test the Connection โ
Click Test to verify the SMTP connection and send a test email. Check the recipient's inbox (and spam folder) for the test message.
Common SMTP Configurations โ
Gmail
Host: smtp.gmail.com
Port: 587
Security: STARTTLS
User: your-email@gmail.com
Password: App Password (not regular password)Generate an App Password at: Google Account โ Security โ 2-Step Verification โ App passwords
Gmail App Passwords
Regular passwords won't work with Gmail SMTP. You must create an App Password, which requires 2-Step Verification to be enabled.
SendGrid
Host: smtp.sendgrid.net
Port: 587
Security: STARTTLS
User: apikey
Password: Your SendGrid API key (SG.xxx)Mailgun
Host: smtp.mailgun.org
Port: 587
Security: STARTTLS
User: postmaster@your-domain.mailgun.org
Password: SMTP password from Mailgun dashboardAmazon SES
Host: email-smtp.us-east-1.amazonaws.com
Port: 587
Security: STARTTLS
User: SMTP username (from SES console)
Password: SMTP password (from SES console)Self-Hosted (Postfix)
Host: mail.example.com
Port: 587
Security: STARTTLS
User: (if required)
Password: (if required)Mailtrap (Testing)
Host: sandbox.smtp.mailtrap.io
Port: 2525
Security: STARTTLS
User: Your Mailtrap username
Password: Your Mailtrap passwordEmail Format โ
HTML emails include:
- Colored Header Bar โ Green for success, red for failure, blue for info
- Title โ Event type (used as email subject:
[DBackup] Backup Successful) - Message Body โ Summary text
- Fields Table โ Structured key-value data (job name, duration, size, etc.)
- Footer โ Timestamp
The same template is used for all notification types (backup, restore, login, system events).
Multiple Recipients โ
The To field supports multiple email addresses. Add recipients as tags โ each email is validated individually.
Per-User Notifications โ
For User Login and User Created events, DBackup can send an email directly to the affected user (e.g., a login notification to the user who just logged in).
This is configured in Settings โ Notifications (not in the notification channel itself). See System Notifications for details.
Security Settings โ
| Setting | Port | Description |
|---|---|---|
| None | 25 | Unencrypted (not recommended) |
| SSL | 465 | Implicit TLS โ encrypted from start |
| STARTTLS | 587 | Upgrade to TLS after connecting (recommended) |
WARNING
Always use SSL or STARTTLS in production to encrypt email credentials and content during transport.
Troubleshooting โ
Connection Refused โ
Connection refused to smtp serverSolutions:
- Verify the SMTP host and port are correct
- Check firewall allows outbound connections on the SMTP port
- Verify the SMTP server is running and accepting connections
- If running in Docker, ensure the container can reach the mail server
Authentication Failed โ
Invalid login credentialsSolutions:
- Double-check username and password
- For Gmail, use an App Password (not your regular password)
- Verify the security setting matches what the server expects
- Some providers require enabling "Less secure apps" or SMTP access
Email Not Received โ
Check:
- Spam/junk folder
- Correct "To" address
- Sender domain reputation
- SMTP server logs for delivery status
- SPF/DKIM/DMARC records for the sender domain
Timeout โ
Connection timed outSolutions:
- Verify the port is correct (common mistake: using 25 instead of 587)
- Check if the SMTP server is behind a firewall
- Try a different security setting
- Increase timeout if the server is slow
Best Practices โ
- Use STARTTLS or SSL โ Never send credentials unencrypted
- Set a proper From address โ Use a recognizable sender like
dbackup@example.com - Configure SPF/DKIM โ Prevents emails from landing in spam
- Use App Passwords โ For Gmail and other providers that support them
- Test regularly โ SMTP credentials can expire or be rotated
- Don't use personal email โ Set up a dedicated service account