New to SMTP? Check out our SMTP credentials guide to get started, or try our HTTP API for a more modern approach.
Which SMTP Settings Should I Use?
Usesend.ahasend.com for the EU connection or send-us.ahasend.com for the US connection point. Both accept the same credentials and ports.
All message data is stored in the EU. See SMTP limits.
Does AhaSend Support Port 465?
No. AhaSend supports STARTTLS on ports 25, 587 and 2525. It does not support implicit TLS on port 465. Create an SMTP credential, then connect, start TLS and authenticate with AUTH PLAIN.What Are the SMTP Limits?
The recipient limit applies to consecutive
RCPT TO commands in one SMTP transaction. The connection limit applies to consecutive MAIL FROM commands; extra commands receive a transient failure. The timeout also applies to slow transmission during DATA.
Base64 increases attachment size by about one third, so a 15 MB file uses about 20 MB before headers and message content are added. Messages over the limit are rejected during the SMTP transaction with a permanent size error (see SMTP errors); nothing is truncated. The same 20 MiB limit applies to inbound mail received for message routing. The API accepts request bodies up to 30 MB so that a maximum-size message still fits once JSON and base64 overhead are added.
Hourly sending limits start low for new accounts and grow with account age, plan and sending reputation; support can raise them. See facts and limits.
What Do SMTP Response Codes Mean?
AhaSend returns standard SMTP response codes with specific meanings:Success Codes
Error Codes
How Do I Set Per-message Options?
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.

