Copy Code
curl -X POST https://api.photonconsole.com/v1/send \
-H "Authorization: Bearer pr_live_8f9c2e4a1b7d5e " \
-H "Content-Type: application/json" \
-d '{
"from": "Security Alert <security@mycompany.com >",
"to": ["developer@example.com "],
"subject": "Your Verification Code: 482910",
"html": "<p>Your login OTP is <strong>482910</strong>. Expires in 10 minutes.</p>",
"text": "Your login OTP is 482910. Expires in 10 minutes."
}'
const nodemailer = require("nodemailer");
// Initialize PhotonRelay high-throughput SMTP transport
const transporter = nodemailer.createTransport({
host: "smtp.photonrelay.com",
port: 587,
secure: false, // TLS via STARTTLS
auth: {
user: "api",
pass: "pr_live_8f9c2e4a1b7d5e "
}
});
async function sendOtp() {
const info = await transporter.sendMail({
from: '"Security Alerts" <security@mycompany.com >',
to: "developer@example.com ",
subject: "Your One-Time Password",
text: "Your OTP is 482910. Valid for 10 minutes.",
html: "<h2>Your Verification Code: <span style='color:#2563EB'>482910</span></h2>"
});
console.log("Message sent in sub-second latency! ID:", info.messageId);
}
sendOtp();
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# Compose email
msg = MIMEMultipart("alternative")
msg["Subject"] = "Your Verification Code: 482910"
msg["From"] = "security@mycompany.com "
msg["To"] = "developer@example.com "
html_body = "<h3>Your Login OTP is: <b>482910</b></h3>"
msg.attach(MIMEText(html_body, "html"))
# Connect directly to PhotonRelay warm TLS cluster
with smtplib.SMTP("smtp.photonrelay.com", 587) as server:
server.starttls()
server.login("api", "pr_live_8f9c2e4a1b7d5e ")
server.sendmail(msg["From"], [msg["To"]], msg.as_string())
print("Dispatched to primary inbox in < 750ms!")
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
// PhotonRelay SMTP configuration
$mail->isSMTP();
$mail->Host = 'smtp.photonrelay.com';
$mail->SMTPAuth = true;
$mail->Username = 'api';
$mail->Password = 'pr_live_8f9c2e4a1b7d5e ';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
// Sender & Recipient
$mail->setFrom('security@mycompany.com ', 'Security Team');
$mail->addAddress('developer@example.com ');
// Message payload
$mail->isHTML(true);
$mail->Subject = 'Your Verification Code: 482910';
$mail->Body = '<p>Your login verification code is <b>482910</b>.</p>';
$mail->AltBody = 'Your login verification code is 482910.';
$mail->send();
echo 'OTP dispatched successfully!';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
package main
import (
"fmt"
"net/smtp"
)
func main() {
from := "security@mycompany.com "
pass := "pr_live_8f9c2e4a1b7d5e "
to := []string{"developer@example.com "}
host := "smtp.photonrelay.com"
port := "587"
msg := []byte("To: " + to[0] + "\r\n" +
"From: " + from + "\r\n" +
"Subject: Your Login OTP: 482910\r\n" +
"Content-Type: text/html; charset=UTF-8\r\n\r\n" +
"<h3>Your verification code is <b>482910</b></h3>")
auth := smtp.PlainAuth("", "api", pass, host)
err := smtp.SendMail(host+":"+port, auth, from, to, msg)
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Message dispatched in under 1 second!")
}
using System;
using MailKit.Net.Smtp;
using MimeKit;
class Program {
static void Main(string[] args) {
var message = new MimeMessage();
message.From.Add(new MailboxAddress("Security Team", "security@mycompany.com "));
message.To.Add(new MailboxAddress("Developer", "developer@example.com "));
message.Subject = "Your Login Verification Code: 482910";
message.Body = new TextPart("html") {
Text = "<p>Your one-time passcode is <b>482910</b>.</p>"
};
using (var client = new SmtpClient()) {
client.Connect("smtp.photonrelay.com", 587, MailKit.Security.SecureSocketOptions.StartTls);
client.Authenticate("api", "pr_live_8f9c2e4a1b7d5e ");
client.Send(message);
client.Disconnect(true);
}
Console.WriteLine("Sent via PhotonRelay successfully!");
}
}