Settings - Mail

Configure SMTP servers, mail spooling, and email delivery settings

Overview

The Mail Settings page controls how ColdFusion sends email via the cfmail tag. You can configure multiple SMTP servers for redundancy, set up mail spooling for asynchronous delivery, configure authentication and encryption, and manage mail queue behavior. Proper configuration ensures reliable email delivery and optimal performance.

SMTP Server Configuration

Configure primary and backup SMTP servers for email delivery.

Mail Server (SMTP)

PurposePrimary SMTP server hostname or IP address
DefaultEmpty (must be configured; neo-mail.xml, key server, in the ColdFusion 2025 Update 14 Docker image)
Examplesmtp.example.com, smtp.gmail.com, mail.privateemail.com
RecommendationUse internal relay server for production environments
Multiple Servers: In Enterprise Edition, add Backup Mail Servers for failover redundancy to ensure email delivery even if primary server is unavailable.

Server Port

PurposeSMTP port number
Default25 (standard SMTP)
Common Ports25 - Standard SMTP (often blocked by ISPs)
587 - Submission port with STARTTLS (recommended)
465 - SMTPS (implicit SSL/TLS, legacy)
2525 - Alternative submission port
RecommendationUse port 587 with TLS for secure, reliable delivery

Username & Password

PurposeSMTP authentication credentials
RecommendationAlways use authentication in production
FormatUsually email address or username
Security: Use application-specific passwords when available. For Gmail/Google Workspace, use App Passwords, not account password.

Enable SSL Socket Connections / Enable TLS Connection

PurposeTwo separate checkboxes: one enables SSL encryption on the connection to the mail server, the other enables Transport Level Security (TLS)
RecommendationAlways enable for security
OptionsTLS (STARTTLS): Upgrades plain connection to encrypted (port 587)
SSL: Encrypted from start (port 465)
ImpactProtects credentials and email content in transit

Verify Mail Server Connection

PurposeTest SMTP server connectivity and authentication
UseCheck the option; ColdFusion verifies it can connect to the mail server after you submit the form
Best Practice: Adobe also recommends sending a test message to confirm the connection works.

Mail Spool Settings

Configure asynchronous email processing and queue management.

Enable Mail Spool

PurposeSpool messages to disk and process them in the background instead of sending during the request. Adobe notes disk-spooled mail survives power outages and server crashes.
RecommendationAlways enable for production environments
BenefitsFaster page response times (email queued, not sent during request)
Page requests are not blocked by slow SMTP servers
ImpactEmail delivery is delayed by spool interval (typically seconds)

Spool Interval (Seconds)

PurposeInterval at which the mail server processes spooled mail
Default15 seconds (verified in the ColdFusion 2025 Update 14 configuration, neo-mail.xml, key schedule, shipped in Adobe's official Docker image)
RecommendationMost apps: 5-15 seconds
High Volume: 1-5 seconds
Low Volume: 30-60 seconds
Trade-offLower interval = faster delivery but more processing overhead

Spool Mail Messages For Delivery To (Disk or Memory)

PurposeChoose whether queued messages are held on disk or in memory
EditionSpooling to memory is Enterprise only
Disk Locationcfusion/Mail/Spool (the cfusion/Mail directory holds spooled and undeliverable mail; Source: Adobe: Install the server configuration)
ConsiderationsDisk is slower, but messages persist across shutdowns. Memory is faster, but messages do not persist. A separate setting caps how many messages spool to memory before ColdFusion switches to disk.
Monitoring: Watch for a growing queue indicating delivery issues. Allocate sufficient disk space for peak mail volumes.

Mail Delivery Threads

PurposeMaximum number of simultaneous threads used to deliver spooled mail
EditionEnterprise only
RecommendationRaise only as far as your SMTP server or provider rate limits allow

Undelivered Mail

How ColdFusion handles messages that fail to send.

Failed Deliveries

BehaviorIf a message is not delivered because of an error, ColdFusion writes it to the Undelivr directory and logs the file name in mail.log. To resend it, you move it back yourself.
Location_CFusion_\Mail\Undelivr (Windows), /opt/coldfusion/mail/undelivr (UNIX)
RecoveryAfter fixing the cause, move the message files from Undelivr to the Spool directory. The Administrator's View Undelivered Mail option lists them.
Maintenance Required: Monitor this directory. Messages stay here until you move them. Investigate patterns of undeliverable mail and set up alerts for accumulation.

Advanced Settings

Configure additional mail server options and logging.

Backup Mail Servers

Edition
Enterprise only
Purpose
Comma-separated list of backup SMTP servers; use username:password@server:port when authentication or a non-default port is needed
Recommendation
Configure backup server for high-availability

Use different providers/infrastructure for true redundancy. Example: Primary = internal relay, Backup = external service (SendGrid, SES)

Mail Character Set

Default
UTF-8
Recommendation
Always use UTF-8 for international character support

Default character encoding for email messages. Can be overridden per-message in cfmail tag.

Sign Messages

Use Case
Required for certain compliance scenarios
Requirement
Keystore (JKS or PKCS12), keystore password, and optionally key alias and key password

Digitally sign outgoing emails with certificate for compliance and security.

Mail Logging

Default
Warning (neo-mail.xml, key severity, in the ColdFusion 2025 Update 14 Docker image)
Severity Levels
Debug, Information, Warning, Error
Recommendation
Information for production, Debug for troubleshooting
Location
mail.log (errors) and mailsent.log (sent messages, when Log All Mail Messages is enabled) in the ColdFusion logs directory

Log mail operations including SMTP transactions, delivery attempts, and errors.

Popular SMTP Provider Settings

Quick reference for common email service provider configurations.

Gmail / Google Workspace

Server
smtp.gmail.com
Port
587 (TLS enabled)
Authentication
Email address and App Password
Limit
500/day (Gmail), higher for Workspace

Must use App Passwords, not regular password (requires 2FA enabled on Google account).

Microsoft 365 / Outlook.com

Server
smtp-mail.outlook.com or smtp.office365.com
Port
587 (TLS enabled)
Authentication
Full email address; OAuth access token as the password where Microsoft requires OAuth
Limit
300/day (Outlook), 10,000/day (M365)

Adobe documents OAuth for SMTP by passing an access token in the cfmail password attribute (server smtp.office365.com, port 587, TLS). The published fix targets ColdFusion 2021 and 2018 and adds the JVM flag -Dcoldfusion.mail.oauth2=true; confirm the steps for your release.

SendGrid

Server
smtp.sendgrid.net
Port
587 or 2525 (TLS enabled)
Username
apikey (literal string)
Password
Your SendGrid API key
Limit
Varies by plan; check SendGrid

Amazon SES

Server
email-smtp.us-east-1.amazonaws.com
Port
587 (TLS enabled)
Credentials
SMTP username/password from SES console

Region-specific endpoint. Start in sandbox mode, request production access.

Mailgun

Server
smtp.mailgun.org
Port
587 (TLS enabled)
Username
postmaster@your-domain.mailgun.org
Password
SMTP password from Mailgun dashboard

Best Practices

Production Environment

  • Always enable mail spooling for async delivery
  • Configure backup SMTP server for redundancy
  • Use TLS encryption for all SMTP connections
  • Set spool interval based on volume (5-15 seconds typical)
  • Monitor undelivered mail directory for delivery issues
  • Configure appropriate rate limiting for your SMTP provider
  • Use dedicated SMTP service (SendGrid, SES) for high volume
  • Implement SPF, DKIM, and DMARC records for deliverability
  • Monitor mail.log for errors and delivery failures

Development Environment

  • Use mail capture tools (MailHog, Papercut) to avoid sending real emails
  • Configure test SMTP server separate from production
  • Set longer spool intervals to reduce processing overhead
  • Enable debug logging to troubleshoot issues

Security Considerations

  • Always use authentication - never allow anonymous relay
  • Enable TLS/SSL encryption to protect credentials
  • Use app-specific passwords instead of primary account passwords
  • Restrict SMTP relay to authorized IP addresses when possible
  • Implement rate limiting to prevent email flooding
  • Validate email addresses to prevent injection attacks
  • Monitor for unusual sending patterns indicating compromise
  • Rotate SMTP credentials periodically

Performance Tuning

  • Enable mail spooling to prevent cfmail from blocking requests
  • Adjust spool interval based on volume and latency requirements
  • Increase mail delivery threads (Enterprise) for high-volume applications
  • Use multiple SMTP servers to distribute load
  • Monitor spool directory size - large queues indicate issues
  • Consider external mail service for bulk sending

Common Issues and Solutions

Email Not Sending

  • Symptom: cfmail executes but emails never arrive
  • Check: SMTP server settings, authentication, port accessibility
  • Solution: Use "Verify Connection" to test configuration
  • Firewall: Ensure SMTP ports (587, 465, 25) are not blocked
  • Logs: Check mail.log for connection errors

Authentication Failed

  • Symptom: "Authentication failed" error in mail.log
  • Gmail: Use App Password (requires 2FA enabled on Google account)
  • Office 365: Verify SMTP AUTH is enabled for mailbox
  • Solution: Double-check username, password, and authentication method

Emails Going to Spam

  • Symptom: Emails delivered but marked as spam
  • SPF Record: Add SMTP server to SPF record
  • DKIM: Configure DKIM signing for authentication
  • DMARC: Implement DMARC policy
  • Content: Avoid spam trigger words, include unsubscribe link
  • Reputation: Use reputable SMTP service, warm up IP address

Spool Queue Growing

  • Symptom: Thousands of files in spool directory
  • Cause: SMTP server unavailable, rejecting connections, or throttling the sender
  • Solution: Check SMTP connectivity and authentication, then move any messages in the Undelivr directory back to Spool
  • Prevention: Monitor queue depth, alert on growth

Slow Page Performance

  • Symptom: Pages with cfmail tag load slowly
  • Cause: Mail spooling disabled, sending synchronously
  • Solution: Enable mail spooling for async delivery
  • Alternative: Use cfthread for immediate sending without blocking

Connection Timeout

  • Symptom: "Connection timeout" errors
  • Firewall: SMTP port blocked by firewall or security group
  • Network: Network connectivity issues
  • Solution: Verify port accessibility using telnet or nc
  • Test: telnet smtp.example.com 587

Monitoring and Maintenance

Daily Monitoring

  • Check spool directory size - should be near empty
  • Review mail.log for errors
  • Monitor undelivered directory for failed messages
  • Track email delivery metrics (sent, failed, bounced)

Weekly Maintenance

  • Review undelivered messages, investigate patterns
  • Archive or delete old mail.log files
  • Check for mail server connectivity issues
  • Verify backup SMTP server is functional

Alerts to Configure

  • Spool queue exceeds 100 messages
  • Undelivered directory exceeds 50 messages
  • SMTP connection failures exceed threshold
  • Mail.log shows authentication failures

Related Resources

Settings - Mail | ColdFusion Administrator | CFGuide