
Prerequisites
Verified Domain
Make sure you have a verified domain added in AutoSend to send emails from.
API Key
Create a new API key for SMTP authentication or use the existing one.
Configuration
1
Install Nodemailer
Install the Nodemailer package using your preferred package manager:
2
Create the SMTP Transporter
Configure the Nodemailer transporter with your AutoSend SMTP credentials:
| Field | Value |
|---|---|
| Host | smtp.autosend.com |
| Port | 465 (recommended) or 587 |
| Username | autosend |
| Password | Your AutoSend API key (AS_xxx) |
| Secure | true for port 465, false for port 587 |
3
Send an Email
Use the
sendMail method to send your email:The
from address must use a domain that is verified in AutoSend. For example, if you verified yourdomain.com, use an address like [email protected].4
Verify Delivery
Check the Email Activity dashboard to verify your email was sent successfully. You’ll see delivery status, opens, clicks, and other engagement metrics.
Complete Examples
Advanced Usage
Sending with Attachments
Sending to Multiple Recipients
Plain Text and HTML
Troubleshooting
Emails not being sent
Emails not being sent
- Verify your SMTP credentials are correct - Check that your sender email domain is verified in
AutoSend - Ensure the
fromaddress matches a verified domain - Check your application logs for SMTP connection errors
Authentication failed
Authentication failed
- Double-check your API key is correct - Ensure you’re using
autosendas the username - Verify your API key is active in the AutoSend dashboard - Make sure there are no extra spaces in the credentials
Connection errors
Connection errors
- Verify the hostname is
smtp.autosend.com- Try using port587withsecure: falseif port465fails - Check if your network or firewall blocks outbound SMTP connections - Test connectivity:telnet smtp.autosend.com 465
Emails going to spam
Emails going to spam
- Ensure your domain has proper DNS records (SPF, DKIM, DMARC) - Use a professional sender name and address - Check your domain reputation in AutoSend - Avoid spam trigger words in your email content