SMTP Configuration Guide
Complete guide to configuring email notifications for ATStatus. This guide covers all major email providers with step-by-step instructions.
SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending emails. ATStatus uses SMTP to send incident notifications, maintenance alerts, and subscriber updates. You'll need access to an SMTP server to enable email notifications.
Overview
ATStatus supports any SMTP server. This guide provides detailed configuration instructions for the most common email providers. Choose your provider from the list below or use the generic settings for other providers.
Supported Providers
- Microsoft 365 / Exchange Online
- Gmail / Google Workspace
- cPanel / Webmail
- DirectAdmin
- Generic SMTP Server
Environment Variables
Add these variables to your .env file to configure SMTP:
| Variable | Description | Example |
|---|---|---|
SMTP_HOST | SMTP server hostname | smtp.office365.com |
SMTP_PORT | SMTP server port | 587 |
SMTP_SECURE | Use SSL/TLS (true for port 465) | false |
SMTP_USER | SMTP username (usually email address) | alerts@company.com |
SMTP_PASS | SMTP password or app password | your-app-password |
SMTP_FROM | Sender email address | alerts@company.com |
SMTP_FROM_NAME | Sender display name (optional) | Status Alerts |
Microsoft 365 / Exchange Online
Step 1: Prepare Your Account
You have two options for authenticating with Microsoft 365:
Option A: App Password (Recommended for Personal Accounts)
- Go to Microsoft Account Security
- Click Advanced security options
- Under "Additional security", enable Two-step verification (required for app passwords)
- After enabling 2FA, go back to Advanced security options
- Under "App passwords", click Create a new app password
- Copy the generated 16-character password immediately (you won't see it again)
Option B: SMTP AUTH with Organization Account
If you're using a Microsoft 365 organization account, your admin may need to enable SMTP AUTH:
- Sign in to Microsoft 365 Admin Center
- Go to Users → Active users
- Select the user account you'll use for sending emails
- Click the Mail tab
- Under "Email apps", click Manage email apps
- Enable Authenticated SMTP
- Click Save changes
Step 2: Configure ATStatus
Add these settings to your .env file:
# Microsoft 365 SMTP Configuration
SMTP_HOST="smtp.office365.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="your-email@yourdomain.com"
SMTP_PASS="your-app-password-or-account-password"
SMTP_FROM="your-email@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"SMTP_FROM address must match the SMTP_USERaddress. Microsoft 365 does not allow sending from a different address unless you have configured Send As permissions.Microsoft 365 Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| Authentication failed | Wrong password or SMTP AUTH disabled | Use app password or enable SMTP AUTH in admin center |
| 5.7.3 Authentication unsuccessful | Security defaults blocking SMTP | Admin must disable security defaults or use Conditional Access |
| Unable to relay | FROM address mismatch | Ensure SMTP_FROM matches the authenticated user's email |
| Connection timeout | Port blocked by firewall | Ensure port 587 is open on your server/network |
Gmail / Google Workspace
Step 1: Enable 2-Factor Authentication
App passwords require 2-factor authentication to be enabled:
- Go to Google Account Security
- Under "How you sign in to Google", click 2-Step Verification
- Follow the prompts to enable 2-Step Verification
- Choose your preferred verification method (phone, authenticator app, etc.)
Step 2: Create an App Password
- Go to Google App Passwords
- You may need to sign in again
- Under "Select app", choose Other (Custom name)
- Enter a name like ATStatus
- Click Generate
- Copy the 16-character password (spaces don't matter)
If you don't see the App Passwords option, your Google Workspace administrator may have disabled it. Contact your IT administrator to enable "Less secure app access" or app passwords for your organization.
Step 3: Configure ATStatus
# Gmail SMTP Configuration
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="your-email@gmail.com"
SMTP_PASS="xxxx xxxx xxxx xxxx"
SMTP_FROM="your-email@gmail.com"
SMTP_FROM_NAME="Status Alerts"Alternative: SSL Configuration (Port 465)
# Gmail SMTP with SSL
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="465"
SMTP_SECURE="true"
SMTP_USER="your-email@gmail.com"
SMTP_PASS="xxxx xxxx xxxx xxxx"
SMTP_FROM="your-email@gmail.com"
SMTP_FROM_NAME="Status Alerts"Google Workspace Additional Steps
If you're using Google Workspace (business), you may need to enable SMTP relay:
- Sign in to Google Admin Console
- Go to Apps → Google Workspace → Gmail → Routing
- Under "SMTP relay service", click Configure
- Add a new SMTP relay configuration
- Set "Allowed senders" to "Only registered Apps users in my domains"
- Enable "Require SMTP Authentication"
- Click Save
Gmail Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| Invalid login | Using account password instead of app password | Generate and use an app password |
| Application-specific password required | 2FA enabled but no app password | Create an app password in Google Account settings |
| Username and Password not accepted | App password typed incorrectly | Regenerate app password and copy exactly |
| Daily sending limit reached | Gmail has sending limits (500/day for free, 2000/day for Workspace) | Wait 24 hours or upgrade to Google Workspace |
cPanel / Webmail
Step 1: Find Your SMTP Settings
- Log in to your cPanel dashboard
- Go to Email → Email Accounts
- Click Connect Devices next to your email account
- Note the "Outgoing Server" details
Step 2: Create an Email Account (if needed)
- In cPanel, go to Email → Email Accounts
- Click Create
- Enter the username (e.g.,
alerts) - Set a strong password and note it down
- Set the mailbox quota (250 MB is usually enough)
- Click Create
Step 3: Configure ATStatus
# cPanel SMTP Configuration
SMTP_HOST="mail.yourdomain.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="alerts@yourdomain.com"
SMTP_PASS="your-email-password"
SMTP_FROM="alerts@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"Alternative: SSL Configuration (Port 465)
# cPanel SMTP with SSL
SMTP_HOST="mail.yourdomain.com"
SMTP_PORT="465"
SMTP_SECURE="true"
SMTP_USER="alerts@yourdomain.com"
SMTP_PASS="your-email-password"
SMTP_FROM="alerts@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"mail.yourdomain.com(most common)smtp.yourdomain.comserver123.hostingprovider.com(server hostname)
cPanel Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| Connection refused | Wrong port or server hostname | Check cPanel "Connect Devices" for correct settings |
| Authentication failed | Wrong username or password | Use full email address as username, reset password if needed |
| Certificate error | SSL certificate mismatch | Use the server hostname instead of your domain name |
| Mail stuck in queue | Sending limits exceeded | Contact hosting provider about email limits |
DirectAdmin
Step 1: Find Your SMTP Settings
- Log in to DirectAdmin
- Go to Email Manager
- Click Email Accounts
- Click on your email account
- Click Email Client Configuration
- Note the SMTP server and port
Step 2: Create an Email Account (if needed)
- In DirectAdmin, go to Email Manager → Email Accounts
- Click Create Mail Account
- Enter the username (e.g.,
alerts) - Set a strong password
- Set the quota (optional)
- Click Create
Step 3: Configure ATStatus
# DirectAdmin SMTP Configuration
SMTP_HOST="mail.yourdomain.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="alerts@yourdomain.com"
SMTP_PASS="your-email-password"
SMTP_FROM="alerts@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"With SSL (Port 465)
# DirectAdmin SMTP with SSL
SMTP_HOST="mail.yourdomain.com"
SMTP_PORT="465"
SMTP_SECURE="true"
SMTP_USER="alerts@yourdomain.com"
SMTP_PASS="your-email-password"
SMTP_FROM="alerts@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"DirectAdmin Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| Connection timeout | Firewall blocking port | Contact hosting provider to open SMTP ports |
| Authentication error | Incorrect credentials | Verify email and password in DirectAdmin |
| TLS negotiation failed | SSL/TLS mismatch | Try switching between port 587 (STARTTLS) and 465 (SSL) |
Generic SMTP Server
For other SMTP providers, use these general guidelines:
Common Port Settings
| Port | Security | SMTP_SECURE | Description |
|---|---|---|---|
| 25 | None/STARTTLS | false | Legacy, often blocked by ISPs |
| 587 | STARTTLS | false | Recommended for most servers |
| 465 | SSL/TLS | true | Implicit SSL connection |
| 2525 | STARTTLS | false | Alternative when 587 is blocked |
Generic Configuration Template
# Generic SMTP Configuration
SMTP_HOST="smtp.yourprovider.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="your-username"
SMTP_PASS="your-password"
SMTP_FROM="sender@yourdomain.com"
SMTP_FROM_NAME="Status Alerts"Email Deliverability
To ensure your status notifications reach recipients and don't end up in spam, configure these DNS records for your sending domain.
SPF Record
SPF (Sender Policy Framework) tells email servers which servers are allowed to send email for your domain.
# Example SPF record (add as TXT record for your domain)
v=spf1 include:spf.protection.outlook.com include:_spf.google.com ~allinclude: value.DKIM (DomainKeys Identified Mail)
DKIM adds a digital signature to your emails to verify they haven't been tampered with. This is usually configured in your email provider's admin panel.
- Microsoft 365: Enable DKIM in Microsoft 365 Defender → Email authentication
- Google Workspace: Enable in Admin Console → Apps → Gmail → Authenticate email
- cPanel/DirectAdmin: Usually auto-configured, check Email Deliverability in your control panel
DMARC Record
DMARC (Domain-based Message Authentication, Reporting & Conformance) tells email servers what to do with emails that fail SPF or DKIM checks.
# Example DMARC record (add as TXT record for _dmarc.yourdomain.com)
v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@yourdomain.comTesting Your Configuration
After configuring SMTP, test it from the ATStatus admin panel:
- Log in to the admin panel at
/admin - Go to Settings → Notifications
- Look for the Test Email option
- Enter a test recipient email address
- Click Send Test Email
- Check the recipient's inbox (and spam folder)
Common Issues & Solutions
Connection Timeouts
- Cause: Firewall blocking outbound SMTP ports
- Solution: Ensure ports 587 and/or 465 are open on your server. Contact your hosting provider if needed.
Authentication Failures
- Cause: Wrong credentials, using account password instead of app password
- Solution: Generate a new app password and ensure you're using the full email address as the username.
Certificate Errors
- Cause: SSL certificate doesn't match the hostname
- Solution: Use the server's actual hostname instead of your domain (e.g.,
server123.host.cominstead ofmail.yourdomain.com)
Emails Going to Spam
- Cause: Missing or incorrect SPF/DKIM/DMARC records
- Solution: Configure proper DNS records as described in the Email Deliverability section.
Rate Limiting / Sending Limits
- Cause: Most email providers limit the number of emails you can send per day
- Solution: For high-volume notifications, consider a dedicated email service like SendGrid, Mailgun, or Amazon SES.
Security Best Practices
- Use App Passwords: Always use app-specific passwords instead of your main account password
- Use TLS/SSL: Always use encrypted connections (port 587 with STARTTLS or port 465 with SSL)
- Dedicated Account: Create a dedicated email account for sending notifications rather than using a personal account
- Monitor Usage: Regularly check your email account for unusual activity
- Rotate Credentials: Periodically regenerate app passwords, especially if you suspect they may have been compromised
Next Steps
Once SMTP is configured, you can:
- Configure notification templates in the admin panel
- Set up subscriber lists for incident notifications
- Enable automated incident notifications
- Test notifications by creating a test incident
If you're still having trouble with SMTP configuration, check the Troubleshooting Guide or review your email provider's documentation for the most up-to-date settings.
