SMTP
SMTP Relay
Send emails through Samva using standard SMTP protocol. Works with any platform that supports SMTP — Auth0, Supabase, WordPress, and more.
SMTP Relay
Samva provides an SMTP relay at smtp.samva.app so you can send transactional emails from any platform that supports SMTP. Messages sent via SMTP go through the same delivery pipeline as API-sent emails — you get full tracking, analytics, and deliverability features.
Quick Start
| Setting | Value |
|---|---|
| Host | smtp.samva.app |
| Port | 587 (STARTTLS, recommended) or 465 (SSL/TLS) |
| Username | samva |
| Password | Your Samva API key |
| Encryption | TLS required |
Code Examples
Node.js (Nodemailer)
import nodemailer from "nodemailer";
const transporter = nodemailer.createTransport({
host: "smtp.samva.app",
port: 587,
secure: false, // STARTTLS
auth: {
user: "samva",
pass: "sk_sm_your_api_key_here",
},
});
await transporter.sendMail({
from: "you@yourdomain.com",
to: "recipient@example.com",
subject: "Hello from Samva",
html: "<h1>Hello!</h1><p>Sent via SMTP relay.</p>",
});Python (smtplib)
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart("alternative")
msg["Subject"] = "Hello from Samva"
msg["From"] = "you@yourdomain.com"
msg["To"] = "recipient@example.com"
html = "<h1>Hello!</h1><p>Sent via SMTP relay.</p>"
msg.attach(MIMEText(html, "html"))
with smtplib.SMTP("smtp.samva.app", 587) as server:
server.starttls()
server.login("samva", "sk_sm_your_api_key_here")
server.send_message(msg)PHP (PHPMailer)
use PHPMailer\PHPMailer\PHPMailer;
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.samva.app';
$mail->SMTPAuth = true;
$mail->Username = 'samva';
$mail->Password = 'sk_sm_your_api_key_here';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom('you@yourdomain.com');
$mail->addAddress('recipient@example.com');
$mail->Subject = 'Hello from Samva';
$mail->isHTML(true);
$mail->Body = '<h1>Hello!</h1><p>Sent via SMTP relay.</p>';
$mail->send();Ruby
require 'net/smtp'
message = <<~MSG
From: you@yourdomain.com
To: recipient@example.com
Subject: Hello from Samva
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
<h1>Hello!</h1><p>Sent via SMTP relay.</p>
MSG
smtp = Net::SMTP.new('smtp.samva.app', 587)
smtp.enable_starttls
smtp.start('smtp.samva.app', 'samva', 'sk_sm_your_api_key_here', :plain) do |s|
s.send_message(message, 'you@yourdomain.com', 'recipient@example.com')
endGo
package main
import (
"net/smtp"
"strings"
)
func main() {
auth := smtp.PlainAuth("", "samva", "sk_sm_your_api_key_here", "smtp.samva.app")
to := []string{"recipient@example.com"}
msg := strings.Join([]string{
"From: you@yourdomain.com",
"To: recipient@example.com",
"Subject: Hello from Samva",
"MIME-Version: 1.0",
"Content-Type: text/html; charset=UTF-8",
"",
"<h1>Hello!</h1><p>Sent via SMTP relay.</p>",
}, "\r\n")
smtp.SendMail("smtp.samva.app:587", auth, "you@yourdomain.com", to, []byte(msg))
}How It Works
- Your application connects to
smtp.samva.appvia SMTP - Samva authenticates using your API key
- The message is recorded in your Samva dashboard
- Samva delivers the email through your verified domain
- Delivery events (sent, delivered, bounced, opened) are tracked just like API sends
Requirements
- A verified domain in your Samva dashboard
- A Samva API key
- The sender (
From:) address must be on a verified domain