New to SMTP? Check out our SMTP credentials guide to get started, or try our HTTP API for a more modern approach.
Server Endpoints
AhaSend operates SMTP servers in multiple regions for optimal performance:European Server
Hostname:
Location: Germany (Primary)
Best for: European and global traffic
send.ahasend.comLocation: Germany (Primary)
Best for: European and global traffic
US Server
Hostname:
Location: Oregon, USA
Best for: North American traffic
send-us.ahasend.comLocation: Oregon, USA
Best for: North American traffic
Connection Settings
Supported Ports & Encryption
All AhaSend SMTP servers support the following configurations:Authentication Requirements
- Authentication Method: PLAIN authentication over STARTTLS
- Username: Your SMTP username from the dashboard
- Password: Your SMTP password from the dashboard
- STARTTLS: Required for all connections
Get SMTP credentials: Create SMTP credentials in your AhaSend Dashboard in the “Credentials” page or via the API.
Connection Limits & Specifications
Understanding AhaSend’s SMTP limits helps you optimize your email sending:Recipients Per Message
Recipients Per Message
Limit: 50 recipients maximum per messageThis is the maximum number of consecutive
RCPT TO commands that can be issued for a single SMTP transaction.Message Size Limit
Message Size Limit
Limit: 20 MB maximum per messageMessages exceeding this size will be rejected with an error code. This includes:
- Email headers
- Message body (text and HTML)
- All attachments (base64 encoded)
Messages Per Connection
Messages Per Connection
Limit: 10,000 messages maximum per connectionThis is the maximum number of consecutive
MAIL FROM commands that can be issued for a single SMTP connection.When this limit is reached:- Additional
MAIL FROMcommands return transient failures - You should close and reopen the connection
- Existing queued messages are not affected
Most SMTP libraries handle connection pooling automatically, but you may need to configure this for high-volume applications.
Connection Timeout
Connection Timeout
Timeout: 1 minute of inactivityConnections are automatically closed if there’s no new data within 60 seconds. This applies to:
- Idle connections between commands
- Slow data transmission during
DATAcommand - Unresponsive clients
SMTP Response Codes
AhaSend returns standard SMTP response codes with specific meanings:Success Codes
| Code | Description |
|---|---|
250 | OK - Message queued successfully for delivery |
Error Codes
| Code | Description | Action Required |
|---|---|---|
421 | Service Unavailable - This error could be returned as a result of disconnecting idle connections (idle too long), Load shedding (server is overwhelmed and cannot accept new connections), or temporary internal errors | Retry with exponential backoff |
451 | Internal server error - Temporary server issue | Retry the request |
500 | Invalid credentials - Authentication failed | Check username/password |
521 | Account disabled - Account suspended or out of credits | Check account status in dashboard |
552 | Invalid message format - Malformed email content | Validate email structure and headers |
553 | Email rejected - Recipient domain is toxic, temporary, or has typos | Verify recipient domain |
556 | Invalid account or domain - Account or sending domain not configured | Verify domain setup |
Special Headers
AhaSend supports special email headers that modify system behavior:Custom Headers
Learn about custom headers for tracking, routing, and advanced email features
Example Configurations
Basic SMTP Configuration
Programming Language Examples
Node.js
Nodemailer and native SMTP examples
Python
smtplib and popular framework integrations
PHP
PHPMailer and framework examples
Go
Native Go SMTP implementations
.NET
C# and .NET Core examples
Command Line
sendmail, swaks, and curl examples
Best Practices
Connection Management
Connection Management
Optimize your SMTP connections:
- Reuse connections when sending multiple emails
- Implement connection pooling for high-volume sending
- Handle timeouts and reconnections gracefully
- Close connections properly when done
Error Handling
Error Handling
Handle SMTP errors appropriately:
- Implement exponential backoff for
421responses - Retry
451errors with reasonable delays - Don’t retry
5xxerrors (permanent failures) - Log error codes for debugging and monitoring
Performance Optimization
Performance Optimization
Maximize sending performance:
- Use persistent connections for batch sending (up to 10k messages per connection)
- Choose the server closest to your application
- Monitor connection limits and adjust accordingly
Security Considerations
Credential Security
- Store SMTP credentials securely
- Use environment variables, not hardcoded values
- Rotate credentials regularly
- Use scoped credentials when possible
Domain Authentication
- Verify your sending domains
- Configure SPF, DKIM, and DMARC records
- Use dedicated sending domains
- Monitor domain reputation
Prefer HTTP API? While SMTP is great for compatibility, our HTTP API offers better performance, features, and error handling for modern applications.

