AhaSend provides high-performance SMTP relay servers for sending transactional emails. Our SMTP infrastructure supports standard protocols and offers reliable email delivery with comprehensive error handling.
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: send.ahasend.com
Location: Germany (Primary)
Best for: European and global traffic

US Server

Hostname: send-us.ahasend.com
Location: Oregon, USA
Best for: North American traffic
Server selection: Choose the server closest to your application for best performance. Both servers offer identical functionality and delivery capabilities.

Connection Settings

Supported Ports & Encryption

All AhaSend SMTP servers support the following configurations:
Servers: send.ahasend.com | send-us.ahasend.com
Ports: 25, 587, 2525
Encryption: STARTTLS (required)
Authentication: PLAIN (required)
SMTPS not supported: AhaSend does not support implicit SSL/TLS (SMTPS) on port 465. Use STARTTLS on ports 25, 587, or 2525 instead.

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:
Limit: 50 recipients maximum per messageThis is the maximum number of consecutive RCPT TO commands that can be issued for a single SMTP transaction.
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
RCPT TO: <[email protected]>
... (up to 50 recipients)
DATA
For bulk sending to more recipients, send multiple separate messages or use our HTTP API with batch operations.
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)
Remember that attachments are base64 encoded, increasing their size by approximately 33%. A 15MB file becomes ~20MB when encoded.
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 FROM commands 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.
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 DATA command
  • Unresponsive clients
Keep connections active or implement proper reconnection logic in your application to handle timeouts gracefully.

SMTP Response Codes

AhaSend returns standard SMTP response codes with specific meanings:

Success Codes

CodeDescription
250OK - Message queued successfully for delivery

Error Codes

CodeDescriptionAction Required
421Load shedding - Server overwhelmed, cannot accept new connectionsRetry later with exponential backoff
451Internal server error - Temporary server issueRetry the request
500Invalid credentials - Authentication failedCheck username/password
521Account disabled - Account suspended or out of creditsCheck account status in dashboard
552Invalid message format - Malformed email contentValidate email structure and headers
553Email rejected - Recipient domain is toxic, temporary, or has typosVerify recipient domain
556Invalid account or domain - Account or sending domain not configuredVerify domain setup
553 email Rejection: This response is only returned if you enable Recipient Shields in your Account Settings.

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

Host: send.ahasend.com
Port: 587
Security: STARTTLS
Username: your-smtp-username
Password: your-smtp-password
Authentication: PLAIN

Programming Language Examples

Best Practices

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
Handle SMTP errors appropriately:
  • Implement exponential backoff for 421 responses
  • Retry 451 errors with reasonable delays
  • Don’t retry 5xx errors (permanent failures)
  • Log error codes for debugging and monitoring
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

Always use STARTTLS: Unencrypted SMTP connections are not secure and may expose your credentials and email content.

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.