Email configuration is stored in the database and can be updated at runtime through the admin panel at
/admin/settings/email.Email Drivers
XyraPanel supports multiple email delivery methods:SMTP (Recommended)
Send emails via SMTP server. Compatible with most email providers. Use cases:- Gmail, Office 365, or custom mail servers
- Self-hosted mail servers
- General-purpose SMTP providers
Sendmail
Use the system’s sendmail binary. Use cases:- Systems with sendmail/postfix already configured
- Simple local mail delivery
Mailgun
Dedicated Mailgun driver (API-based). Use cases:- High-volume transactional email
- Advanced deliverability features
SMTP Configuration
When using SMTP driver, configure these settings in the admin panel:Email driver to use:
smtp, sendmail, or mailgun.Pre-configured SMTP service provider. Supported values:
gmail- Gmailoutlook- Outlook/Office 365yahoo- Yahoo Mailicloud- iCloud Mailmailgun- Mailgunsendgrid- SendGridmailjet- Mailjetmailtrap- Mailtrap (testing)zoho- Zoho Mail- Custom - Leave blank and configure host/port manually
When using a pre-configured service, you only need to provide username and password. Host and port are set automatically.
SMTP server hostname (e.g.,
smtp.gmail.com).Required only when service is not set.SMTP server port:
587- TLS/STARTTLS (recommended)465- SSL25- Unencrypted (not recommended)
Encryption method:
tls- STARTTLS (port 587)ssl- SSL/TLS (port 465)none- No encryption (not recommended)
SMTP authentication username (usually your email address).
SMTP authentication password or app-specific password.
Email address used in the “From” field (e.g.,
[email protected]).Display name used in the “From” field.
Provider-Specific Setup
Gmail
Gmail
Gmail Setup
- Enable 2-factor authentication on your Google account
- Generate an app-specific password at myaccount.google.com/apppasswords
- Configure in admin panel:
Gmail limits sending to 500 emails per day for free accounts.
Office 365 / Outlook
Office 365 / Outlook
Office 365 / Outlook Setup
- Use your Office 365 email and password
- If using 2FA, create an app password
- Configure in admin panel:
Custom SMTP Server
Custom SMTP Server
SendGrid
SendGrid
SendGrid Setup
- Create a SendGrid account and API key at sendgrid.com
- Configure in admin panel:
SendGrid requires domain verification for production use.
Mailgun
Mailgun
Mailtrap (Testing)
Mailtrap (Testing)
Mailtrap for Testing
Mailtrap catches all emails for testing without sending to real recipients.- Create account at mailtrap.io
- Get SMTP credentials from your inbox
- Configure in admin panel:
Email Templates
XyraPanel sends emails for these events:| Template | Purpose | Trigger |
|---|---|---|
| Welcome Email | Welcome new users | User account created |
| Email Verification | Verify email addresses | New user registration |
| Password Reset | Reset forgotten password | User requests password reset |
| Server Created | Notify of new server | Server provisioned for user |
| Server Suspended | Notify of suspension | Server suspended by admin |
| Server Reinstalled | Notify of reinstallation | Server reinstalled |
| Backup Completed | Notify of backup success | Backup creation completed |
| Admin User Created | Provide login details | Admin creates user account |
Email templates can be customized through the admin panel at
/admin/settings/email/templates.Testing Email Configuration
After configuring email settings:Troubleshooting
Authentication failed
Authentication failed
Symptoms: “Authentication failed” or “Invalid credentials” errorsSolutions:
- Verify username and password are correct
- Use app-specific passwords for Gmail, Office 365, etc.
- Check if your email provider requires 2FA
- Ensure “less secure app access” is enabled (if applicable)
Connection timeout
Connection timeout
Symptoms: “Connection timeout” or “Cannot connect to SMTP server”Solutions:
- Verify SMTP host and port are correct
- Check firewall allows outbound connections on the SMTP port
- Try different ports (587, 465, 25)
- Verify your server’s IP isn’t blocked by the email provider
Emails marked as spam
Emails marked as spam
Symptoms: Emails arrive in spam folderSolutions:
- Set up SPF, DKIM, and DMARC records for your domain
- Use a verified sending domain
- Ensure “From Address” matches your authenticated domain
- Use a reputable email service provider
- Avoid sending too many emails too quickly
Emails not sending
Emails not sending
Symptoms: No errors but emails don’t arriveSolutions:
- Check XyraPanel logs for email sending errors
- Verify email configuration is saved correctly
- Test with Mailtrap to isolate delivery vs configuration issues
- Check email provider’s sending limits
- Verify recipient email address is valid
SSL/TLS errors
SSL/TLS errors
Symptoms: “SSL/TLS handshake failed” or certificate errorsSolutions:
- Try switching between
tls(port 587) andssl(port 465) - Verify your server has up-to-date CA certificates
- Check if your SMTP provider has valid SSL certificates
- Try connecting with
openssl s_client -connect smtp.host.com:587 -starttls smtp
Email Service Recommendations
For Production
SendGrid
Reliable, high-volume email delivery with excellent deliverability.Pros: Free tier (100 emails/day), good deliverability, easy setup
Mailgun
Developer-friendly email API with powerful features.Pros: Free tier (1,000 emails/month), advanced features, reliable
Amazon SES
Cost-effective email service from AWS.Pros: Very cheap, scales infinitely, AWS integration
Postmark
Premium transactional email service.Pros: Excellent deliverability, great support, developer-friendly
For Testing
- Mailtrap - Catches emails in development without sending
- MailHog - Self-hosted email testing tool
- Gmail - Quick setup for small deployments
Environment vs Database
This design allows:- Runtime configuration changes without restarts
- Multiple administrators to manage email settings
- Secure storage of credentials in the database
- Easy backup and migration of settings
Security Best Practices
Use app-specific passwords
Use app-specific passwords
Never use your primary email password. Always generate app-specific passwords for Gmail, Office 365, and other providers that support them.
Enable TLS/SSL
Enable TLS/SSL
Always use encryption (
tls or ssl) for SMTP connections. Never send credentials over unencrypted connections.Restrict database access
Restrict database access
Email credentials are stored encrypted in the database. Ensure your database has proper access controls.
Use dedicated email accounts
Use dedicated email accounts
Create dedicated accounts (like
[email protected]) instead of using personal email accounts.Monitor sending limits
Monitor sending limits
Be aware of your email provider’s rate limits and implement appropriate throttling if needed.
Next Steps
Environment Variables
View all configuration options
Security Settings
Configure security features