Skip to main content
AhaSend SMTP relay settings are listed here: server host, ports and encryption, authentication, message limits and response codes. Available on Free, Pro and Max. See plans and features.
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?

Use send.ahasend.com with your SMTP credentials on port 587, 25 or 2525 with STARTTLS, or on port 465 with implicit TLS. All message data is stored in the EU. See SMTP limits.

Does AhaSend Support Port 465?

Yes. Port 465 uses implicit TLS: your client starts TLS as soon as it connects, before the server greets it, and sends no STARTTLS command. It accepts AUTH PLAIN and AUTH LOGIN. Limits, response codes and special headers are the same on every port. Set your client’s security option to match the port: A client set to STARTTLS on port 465 waits for a greeting that never comes, and the server closes the connection after 30 seconds. A client set to SSL/TLS on port 587 fails at once with a TLS error such as wrong version number. See port 465 problems.

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

553 email Rejection: This response is only returned if you enable Recipient Shields in your Account Settings.

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

Port 465 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

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 TLS: use STARTTLS on ports 25, 587 and 2525, or implicit TLS on port 465. 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.