Send Your First Email
A step-by-step guide to sending your first email through NorthRelay
Send Your First Email
This guide shows you how to send your first email through NorthRelay using SMTP, the REST API, or one of our SDKs.
Before you begin, make sure you have your SMTP credentials ready. See Installation & Quick Start if you have not set up your account yet.
Using SMTP
Node.js with Nodemailer
const nodemailer = require("nodemailer");
const transporter = nodemailer.createTransport({
host: "smtp.north-pipe.ca",
port: 587,
secure: false, // STARTTLS
auth: {
user: "your-email@example.com",
pass: "nr_live_xxxxxxxxxxxx",
},
});
async function sendEmail() {
const info = await transporter.sendMail({
from: "you@yourdomain.com",
to: "recipient@example.com",
subject: "Hello from NorthRelay!",
text: "This is my first email sent through NorthRelay.",
html: "<p>This is my first email sent through <strong>NorthRelay</strong>.</p>",
});
console.log("Message sent:", info.messageId);
}
sendEmail().catch(console.error);Python with smtplib
import smtplib
from email.mime.text import MIMEText
msg = MIMEText("This is my first email sent through NorthRelay.")
msg["Subject"] = "Hello from NorthRelay!"
msg["From"] = "you@yourdomain.com"
msg["To"] = "recipient@example.com"
with smtplib.SMTP("smtp.north-pipe.ca", 587) as server:
server.starttls()
server.login("your-email@example.com", "nr_live_xxxxxxxxxxxx")
server.send_message(msg)
print("Email sent successfully!")Using the REST API
Send an email with a single HTTP request. Authenticate with your API key as a Bearer token.
cURL
curl -X POST https://app.northrelay.ca/api/v1/emails/send \
-H "Authorization: Bearer nr_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"from": { "email": "you@yourdomain.com", "name": "Your App" },
"to": [{ "email": "recipient@example.com" }],
"content": {
"subject": "Hello from NorthRelay!",
"text": "This is my first email sent through NorthRelay.",
"html": "<p>This is my first email sent through <strong>NorthRelay</strong>.</p>"
}
}'from and each to entry are objects with email and an optional name; the subject and body go in content. The from domain must be one you have verified.
Example Response
{
"success": true,
"data": {
"messageId": "<20261006143500.a1b2c3@yourdomain.com>",
"status": "Queued",
"pool": { "type": "Shared", "gateway": "76.13.27.101" },
"quota": { "used": 1, "limit": 3000, "remaining": 2999 }
}
}Using the TypeScript SDK
npm install @northrelay/sdkimport { NorthRelayClient } from "@northrelay/sdk";
const client = new NorthRelayClient({
apiKey: process.env.NORTHRELAY_API_KEY!,
});
async function main() {
const result = await client.emails.send({
from: { email: "you@yourdomain.com" },
to: [{ email: "recipient@example.com" }],
content: {
subject: "Hello from NorthRelay!",
text: "This is my first email sent through NorthRelay.",
},
});
console.log("Email queued:", result.data.messageId);
}
main().catch(console.error);Using the Python SDK
pip install northrelayThe Python SDK is async:
import asyncio
import os
from northrelay import NorthRelay, SendEmailRequest
async def main() -> None:
async with NorthRelay(api_key=os.environ["NORTHRELAY_API_KEY"]) as client:
result = await client.emails.send(
SendEmailRequest(
from_={"email": "you@yourdomain.com"},
to=[{"email": "recipient@example.com"}],
content={
"subject": "Hello from NorthRelay!",
"text": "This is my first email sent through NorthRelay.",
},
)
)
print(f"Email queued: {result.message_id}")
asyncio.run(main())Verifying Delivery
After sending your first email, verify it was delivered successfully:
1. Check Dashboard Logs
Go to Dashboard → Email Logs. You should see your email with one of these statuses:
| Status | Meaning |
|---|---|
queued | Email accepted and waiting to be sent |
sent | Email handed off to the recipient's mail server |
delivered | Recipient's server confirmed receipt |
bounced | Recipient's server rejected the email |
failed | A sending error occurred |
2. Check the Recipient's Inbox
Look in both the inbox and the spam/junk folder. If the email lands in spam, you likely need to set up DNS authentication records. See the DNS Setup Guide.
3. Common Status Codes
| SMTP Code | Meaning | Action |
|---|---|---|
250 | Success | Email accepted |
421 | Service unavailable | Retry in a few minutes |
451 | Rate limit exceeded | Check your quota in Dashboard → Billing |
550 | Mailbox not found | Verify the recipient address |
553 | Authentication required | Check your credentials |
Troubleshooting Quick Tips
Authentication error (535)
- Verify your username is your full account email, not a custom domain address
- Confirm you are using an API key (starts with
nr_live_) as the password - Check that the API key has not been revoked in Dashboard → API Keys
Connection refused
- Ensure your network allows outbound connections on port 587
- Test connectivity:
telnet smtp.north-pipe.ca 587 - If port 587 is blocked, try port 465 (implicit TLS)
Email bounced
- Check that the recipient address is valid
- Set up SPF, DKIM, and DMARC records for your sending domain — see the DNS Setup Guide
- Review the bounce reason in Dashboard → Email Logs
For more detailed troubleshooting, see the Troubleshooting Guide.
Next Steps
- DNS Setup Guide — Improve deliverability with SPF, DKIM, and DMARC
- Node.js Integration — Full Node.js integration with error handling
- Python Integration — Django, Flask, and FastAPI examples
- SMTP Configuration — Advanced SMTP settings and TLS options