Email Settings
Configure SMTP settings for sending system emails, notifications, and renewal reminders.
Breadcrumb: System Configuration > Email Settings
Overview
Email Settings control how PteroCA sends transactional emails including:
Account registration and verification
Password reset requests
Server notifications
Payment confirmations
System alerts
Server renewal notifications
All email delivery is handled through SMTP (Simple Mail Transfer Protocol). You must configure a valid SMTP server to enable email functionality.
Two Types of Settings:
SMTP Configuration - Server connection settings for email delivery
Renewal Notifications - Automated reminders for server renewals
Settings Overview
SMTP Configuration (5 settings):
SMTP Server
Text
✓
✓
Address of SMTP server
SMTP Port
Number
✓
✓
Port for SMTP connection
SMTP Username
Text
✓
✓
Authentication username
SMTP Password
Secret
✓
✓
Authentication password
SMTP From
✓
✓
Sender email address
Renewal Notifications (3 settings):
Enable Renewal Notifications
Boolean
✓
Automatically send renewal reminders
Notification Minimum Frequency
Number
✓
Minimum hours between notifications
On-Demand Minimum Hours
Number
✓
Minimum hours before on-demand notification
Configuration via CLI Wizard
The CLI configuration wizard covers all 5 SMTP settings during initial setup. Renewal notification settings are only configurable via Admin Panel.
Run the Wizard
Email Configuration Prompts
Testing SMTP During Setup
The wizard validates SMTP credentials during configuration by attempting a test connection.
Configuration via Admin Panel
All email settings can be managed through the Admin Panel with the added benefit of a built-in SMTP connection test.
Access Email Settings
Log in to the Admin Panel
Navigate to Settings in the main menu
Click Email
Update values
Click Test SMTP Connection (recommended)
Click Save
Setting Details
SMTP Server
Setting Code: smtp_server Field Type: Text Required: Yes Default: smtp.mailtrap.io
The hostname or IP address of your SMTP server.
Common SMTP Servers:
Gmail
smtp.gmail.com
Requires App Password
Outlook/Office 365
smtp.office365.com
-
Yahoo
smtp.mail.yahoo.com
-
SendGrid
smtp.sendgrid.net
API key required
Mailgun
smtp.mailgun.org
-
Amazon SES
email-smtp.region.amazonaws.com
Replace region
Mailtrap (Testing)
smtp.mailtrap.io
Development only
Postmark
smtp.postmarkapp.com
Server token required
Format:
Validation:
Must be valid hostname or IP
No protocol prefix (no
http://orhttps://)No trailing slash
SMTP Port
Setting Code: smtp_port Field Type: Number Required: Yes Default: 587
The port number used for SMTP connection.
Common Ports:
587
SMTP
TLS/STARTTLS
Recommended - Modern standard
465
SMTPS
SSL
Legacy SSL connections
25
SMTP
None
Not recommended - Often blocked
2525
SMTP
TLS
Alternative to 587 (some providers)
Recommendations:
Use port 587 with TLS - Most compatible and secure
Avoid port 25 - Often blocked by ISPs and cloud providers
Port 465 for legacy systems - Older SSL-only clients
Port 2525 as fallback - If 587 is blocked
Firewall Considerations: Ensure outbound connections on your chosen port are allowed:
SMTP Username
Setting Code: smtp_username Field Type: Text Required: Yes (for most providers) Default: None
Username for SMTP authentication.
Common Formats:
Full Email Address:
Username Only:
API Key (SendGrid, etc.):
Provider-Specific Examples:
SendGrid
apikey
apikey
Amazon SES
IAM access key ID
AKIAIOSFODNN7EXAMPLE
Mailtrap
Username from inbox settings
Generated by Mailtrap
Gmail App Passwords: If using Gmail, you must generate an App Password:
Enable 2-Step Verification on your Google account
Go to https://myaccount.google.com/apppasswords
Select "Mail" and your device
Generate password
Use generated 16-character password as SMTP password
SMTP Password
Setting Code: smtp_password Field Type: Secret (Password) Required: Yes (for most providers) Default: None
Password or API key for SMTP authentication.
Security:
Stored encrypted in database
Displayed as
*****in admin panelNever exposed in logs
Provider-Specific:
Gmail:
Use App Password (not regular password)
16-character format:
xxxx xxxx xxxx xxxx
SendGrid:
Use API key as password
Format:
SG.***
Amazon SES:
Use SMTP password (not IAM secret key)
Generate in SES console under SMTP Settings
Mailgun:
Use SMTP password from domain settings
Not the same as API key
Best Practices:
Never share SMTP password
Use dedicated SMTP credentials (not personal account)
Rotate passwords periodically
Use provider-specific API keys when available
SMTP From (Sender Address)
Setting Code: smtp_from Field Type: Email Required: Yes Default: [email protected]
The email address shown as the sender in outgoing emails.
Format:
Best Practices:
Match Your Domain:
Use same domain as site URL
Improves email deliverability
Reduces spam filtering
Use Descriptive Address:
noreply@- Don't monitor repliessupport@- If you monitor and respondnotifications@- Automated messages
Avoid Personal Addresses:
Don't use personal Gmail/Outlook
Use professional domain
Deliverability Considerations:
SPF Record: Add SPF record to DNS to authorize sending server:
DKIM: Configure DKIM signatures with your provider for authentication.
DMARC: Set DMARC policy to prevent spoofing:
Examples:
Good:
Bad:
Renewal Notification Settings
The following settings control automated server renewal reminders sent to customers.
Note: These settings are only available via Admin Panel, not the CLI wizard.
Access Renewal Notification Settings
Log in to the Admin Panel
Navigate to Settings in the main menu
Click Email
Scroll to Renewal Notifications section
Configure settings
Click Save
Setting Details
Enable Renewal Notifications
Setting Code: renewal_notification_enabled Field Type: Boolean (Toggle) Required: No Default: false
Enable automatic email reminders for customers when their servers are approaching expiration.
When Enabled:
System automatically sends renewal reminders
Notifications sent based on configured frequency
Helps reduce server suspensions due to non-payment
Improves customer retention
When Disabled:
No automatic renewal reminders sent
Customers must manually track renewal dates
Higher risk of unexpected suspensions
Manual notification only
How It Works:
Automatic Checking:
System checks server expiration dates via cron job
Runs periodically (based on cron schedule)
Identifies servers expiring soon
Notification Triggers:
Server expiring within configured timeframe
Minimum frequency elapsed since last notification
Customer has valid email address
Email Content:
Server name and expiration date
Renewal cost and payment link
Account balance information
Instructions for renewal
Benefits:
For Customers:
Timely reminders prevent service interruption
Convenient payment links
Clear renewal information
For Administrators:
Reduced support tickets
Fewer suspended servers
Better cash flow
Improved customer satisfaction
Best Practices:
Enable for production environments
Set reasonable frequency (24-48 hours)
Test email delivery first
Monitor notification logs
Combine with grace period before suspension
Use Cases:
Small Hosting Business:
Large-Scale Provider:
Development Environment:
Notification Minimum Frequency (Hours)
Setting Code: renewal_notification_min_period_hours Field Type: Number Required: Only if notifications enabled Default: 48 Min: 1 hour Recommended: 24-72 hours
Minimum number of hours that must elapse between automatic renewal notification emails to the same customer.
Purpose: Prevents spam by limiting notification frequency. Even if server expires soon, system won't send another notification until this time has passed since the last one.
How It Works:
Recommended Values:
12 hours
Urgent renewals
Quick reminders
May annoy customers
24 hours
Standard
Balanced
Multiple daily emails possible
48 hours
Recommended
Not overwhelming
Fewer reminders
72 hours
Conservative
Minimal emails
May miss urgency
168 hours (7 days)
Minimal
One reminder per week
Not urgent enough
Considerations:
Customer Experience:
Too frequent = spam complaints
Too infrequent = missed renewals
48 hours is good balance
Expiration Timeline:
If server expires in 3 days
With 48-hour frequency
Customer gets 1-2 reminders
Cron Schedule:
If cron runs daily
24-hour frequency = 1 email/day max
48-hour frequency = 1 email every 2 days max
Examples:
Aggressive (Not Recommended):
Balanced (Recommended):
Conservative:
Best Practices:
Start with 48 hours
Monitor customer feedback
Adjust based on renewal patterns
Consider timezone differences
Document in Terms of Service
On-Demand Minimum Hours Before Notification
Setting Code: renewal_notification_on_demand_min_hours Field Type: Number Required: Only if notifications enabled Default: 24 Min: 1 hour Recommended: 12-48 hours
Minimum number of hours that must pass since the last notification before a customer can manually request an on-demand renewal reminder.
Purpose: Prevents abuse of manual notification feature while allowing customers to request reminders when needed.
How It Works:
Scenario 1 - Request Allowed:
Scenario 2 - Request Denied:
On-Demand vs Automatic:
Automatic
Cron job
Notification Minimum Frequency
On-Demand
Customer request
On-Demand Minimum Hours
Common Configurations:
Strict:
Balanced (Recommended):
Flexible:
Very Flexible:
Relationship to Automatic Frequency:
Typically, on-demand minimum should be shorter than automatic frequency:
Use Cases:
Customer forgot to renew:
Automatic: Sent 2 days ago
On-demand: 24-hour minimum
Customer can request reminder now
Includes payment link
Customer wants to check balance:
Last notification: Yesterday
On-demand: 24 hours
Can request new notification
Shows current balance and cost
Emergency notification:
Server expiring in hours
Customer requests reminder
If minimum met, sends immediately
Helps prevent last-minute suspensions
Best Practices:
Set Lower Than Automatic:
Automatic: 48 hours
On-Demand: 24 hours
Gives customers more control
Consider Abuse Prevention:
Don't set too low (< 6 hours)
Monitor request patterns
Adjust based on usage
Customer Communication:
Explain feature in documentation
Show countdown in UI
Clear error messages when denied
Testing:
Test on-demand feature
Verify timing enforcement
Check email delivery
Error Handling:
When customer requests on-demand notification too soon:
Recommended Settings:
Testing SMTP Configuration
Admin Panel Test
The Email Settings page includes a built-in connection test:
Configure all SMTP settings
Click Test SMTP Connection button
Check for success/error message
If successful, click Save
Test Verification:
Verifies connection to SMTP server
Authenticates with provided credentials
Confirms sender address is valid
Does NOT send actual test email
Send Test Email
To send an actual test email:
Alternatively, trigger a password reset to test full email flow.
Common SMTP Providers Setup
Gmail
Settings:
Requirements:
Enable 2-Step Verification
Generate App Password
Less secure app access: Not needed with App Password
Limitations:
500 emails/day limit (free account)
2000 emails/day (Google Workspace)
SendGrid
Settings:
Setup:
Create SendGrid account
Verify sender domain
Generate API key with "Mail Send" permission
Use
apikeyas usernameUse API key as password
Advantages:
100 emails/day (free tier)
Excellent deliverability
Detailed analytics
Mailgun
Settings:
Setup:
Create Mailgun account
Add and verify domain
Copy SMTP credentials from domain settings
Configure DNS records (SPF, DKIM)
Note: SMTP password is different from API key.
Amazon SES
Settings:
Setup:
Verify email address or domain in SES console
Create SMTP credentials in SES settings
Move out of sandbox mode for production
Configure DNS records
Advantages:
62,000 emails/month (free tier with EC2)
Pay-as-you-go pricing
High deliverability
Mailtrap (Development Only)
Settings:
Purpose:
Testing email functionality
Do not use in production
Captures emails without sending
Setup:
Create free Mailtrap account
Copy SMTP credentials from inbox
Configure in PteroCA
All emails appear in Mailtrap inbox
Best Practices
Security
Use TLS/SSL:
Always use port 587 with TLS
Never send credentials unencrypted
Strong Passwords:
Use provider-generated API keys
Rotate credentials periodically
Dedicated Credentials:
Use separate SMTP account for panel
Not your personal email credentials
Deliverability
SPF/DKIM/DMARC:
Configure DNS authentication records
Prevents spoofing and improves delivery
Matching Domain:
Send from same domain as panel
Builds sender reputation
Monitor Blacklists:
Check if sending IP is blacklisted
Use dedicated IP for high volume
Warm-Up Period:
Start with low volume
Gradually increase over weeks
Monitoring
Track Bounces:
Monitor bounce rates
Clean up invalid addresses
Watch for Blocks:
Check provider limits
Monitor SMTP errors in logs
Test Regularly:
Send test emails periodically
Verify across different providers
Troubleshooting
Connection Failures
Problem: Cannot connect to SMTP server
Possible Causes:
Incorrect SMTP server address
Port blocked by firewall
Server/provider down
Solutions:
Test Connection:
Check Firewall:
Verify Provider Status:
Check provider status page
Try alternative port (2525)
Check DNS:
Authentication Failures
Problem: SMTP authentication failed
Causes:
Incorrect username/password
App password not generated (Gmail)
Less secure apps blocked
Solutions:
Verify Credentials:
Double-check username and password
Ensure no extra spaces
Gmail:
Generate App Password
Enable 2-Step Verification first
SendGrid:
Verify API key has "Mail Send" permission
Username must be exactly
apikey
Test Credentials: Use test connection in Admin Panel
Emails Not Sending
Problem: SMTP connection successful but emails don't arrive
Possible Causes:
Spam filtering
Invalid sender address
Domain not verified
Recipient blocks
Solutions:
Check Spam Folder:
First place to look
Mark as "Not Spam"
Verify Sender Domain:
Ensure sender domain is verified with provider
Check SPF/DKIM/DMARC records
Review Email Logs:
Test Different Recipient:
Try different email provider
Rule out recipient-side blocking
Emails Marked as Spam
Problem: Emails consistently go to spam
Causes:
Missing SPF/DKIM records
Sender reputation
Spam-like content
Solutions:
Configure DNS Records:
Add SPF record
Enable DKIM
Set DMARC policy
Improve Content:
Avoid spam trigger words
Include plain text version
Add unsubscribe link
Build Reputation:
Start with low volume
Maintain low bounce rate
Avoid sending to invalid addresses
Use Dedicated IP:
Consider dedicated IP (high volume)
Warm up new IPs gradually
Gmail App Password Issues
Problem: Cannot generate App Password
Cause: 2-Step Verification not enabled
Solution:
Go to https://myaccount.google.com/security
Enable 2-Step Verification
Generate App Password at https://myaccount.google.com/apppasswords
Use 16-character password (without spaces)
SendGrid API Key Errors
Problem: SendGrid authentication fails
Common Mistakes:
Using API key as username (should be
apikey)Using wrong type of API key
Insufficient permissions
Solution:
Username must be:
apikey(lowercase, exactly)Password must be: Full API key starting with
SG.API key must have "Mail Send" permission
Verify sender domain in SendGrid dashboard
Related Settings
General Settings - Configure sender domain in Site URL
Security Settings - Email verification requirements
Additional Resources
SMTP Protocol - Technical background
SPF Record Generator - Create SPF records
DMARC Guide - Email authentication
Gmail SMTP Guide - Google Workspace SMTP
Last updated