Get up and running with AhaSend in under 5 minutes. This guide will walk you through sending your first email using either our REST API or SMTP relay.
Before you start: You’ll need an AhaSend account. Sign up for free to get 1,000 emails per month at no cost.

Sign Up & Verify Email

  1. Sign up for a free account
  2. Verify your email address by clicking the link in your inbox
  3. Log in to your dashboard to continue setup

Add & Configure Domain

Before you can send emails, you need to add and verify your domain:
  1. Add your domain in your dashboard under Domains
  2. Add the DNS records provided by AhaSend to your domain’s DNS settings
  3. Wait for verification (usually takes a few minutes)
Need help with domain setup? Check out our detailed domain configuration guide for step-by-step instructions for all major DNS providers.
Important: You cannot send emails until your domain is verified. The verification process ensures good deliverability and prevents spoofing.

Create Sending Credentials

Create the appropriate credentials for your chosen method:For HTTP API:
  • Go to API Keys in your dashboard
  • Click “Create API Key”
  • Copy and securely store your API key
For SMTP:
  • Go to SMTP Credentials in your dashboard
  • Click “Create SMTP Credential”
  • Save the username and password
Keep your credentials secure! Never commit them to version control or expose them in client-side code.

Send & Verify First Email

Send your first email using the code examples below, then verify delivery:After sending:
  1. Check your inbox - Your test email should arrive within seconds
  2. Check the Messages page in your dashboard to see delivery status
  3. Look for a 202 response with a message ID
Success! See your email in both your inbox and the Messages page? You’re all set up! 🎉
Jump to: HTTP API | SMTP Relay

HTTP API

Send emails using our modern HTTP API. Perfect for web applications and microservices.
API Version Note: These examples use our latest API v2, which provides the most powerful features including advanced tracking, bulk sending, and better error handling. For simpler use cases, you can also use our API v1.

Basic Email

curl -X POST https://api.ahasend.com/v2/accounts/{account_id}/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "from": {
      "name": "My App",
      "email": "[email protected]"
    },
    "recipients": [
      {
        "name": "John Doe",
        "email": "[email protected]"
      }
    ],
    "subject": "Welcome to My App!",
    "text_content": "Thanks for signing up. We'\''re excited to have you!",
    "html_content": "<h1>Welcome!</h1><p>Thanks for signing up. We'\''re <strong>excited</strong> to have you!</p>"
  }'
Replace the placeholders:
  • YOUR_API_KEY with your actual API key from Step 4
  • {account_id} with your account ID from your dashboard
  • [email protected] with your verified domain from Step 2
  • [email protected] with the recipient’s email address

SMTP Relay

Use our SMTP servers with any email library. Great for existing applications or when you need SMTP compatibility.

SMTP Settings

Host: send.ahasend.com
Ports: 25, 587, 2525 (all support STARTTLS)
Authentication: Required
Username: Your SMTP username (from dashboard)
Password: Your SMTP password (from dashboard)
Get SMTP credentials: You should have created these in Step 4. If not, go to your dashboard → Credentials → Create New Credential

SMTP Examples

const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransporter({
  host: 'send.ahasend.com',
  port: 587,
  secure: false, // true for 465, false for other ports
  auth: {
    user: 'YOUR_SMTP_USERNAME',
    pass: 'YOUR_SMTP_PASSWORD'
  }
});

const mailOptions = {
  from: '"My App" <[email protected]>',
  to: '[email protected]',
  subject: 'Welcome to My App!',
  text: 'Thanks for signing up. We\'re excited to have you!',
  html: '<h1>Welcome!</h1><p>Thanks for signing up. We\'re <strong>excited</strong> to have you!</p>'
};

transporter.sendMail(mailOptions, (error, info) => {
  if (error) {
    console.error('Error:', error);
  } else {
    console.log('Email sent:', info.response);
  }
});

Next Steps

Now that you’ve sent your first email, here’s what to do next:

Troubleshooting

Having issues? Here are the most common problems:
Need more help? Email our engineering team at [email protected] - we typically respond within a few hours!