Authentication

Send OTP & Verification Emails

Generate and send one-time passwords and verification codes with sub-200ms delivery.

How it works

1

Generate Secure Code

Create a cryptographically secure 6 to 8 digit OTP or use JWT tokens for verification.

2

Send via API

Call the Transmit email API with the OTP. Delivery happens in under 200ms.

3

Verify on Callback

User enters OTP, your server validates it, and marks it as used to prevent replay.

Capabilities

Sub-200ms Delivery

Verification emails arrive instantly for seamless user experience.

Rate Limiting

Built-in rate limiting prevents OTP abuse and brute force attacks.

Configurable Expiry

Set OTP expiry from 5 to 60 minutes to balance security and usability.

One-Time Use

Each OTP can only be used once, preventing replay attacks.

Generate and Send OTP

typescript
async function sendOtpEmail(email: string, otp: string) {
    const response = await fetch('https://api.xmit.sh/email/send', {
        method: 'POST',
        headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            to: email,
            from: 'noreply@yourdomain.com',
            subject: 'Your Verification Code',
            html: `<p>Your verification code is:</p>
                <h1 style="font-size: 32px; letter-spacing: 4px;">${otp}</h1>
                <p>This code expires in 15 minutes.</p>`,
        }),
    });

    return response.json();
}

Related features

Frequently Asked Questions

How secure are OTP emails?
OTP emails are secure when you use cryptographically random codes, short expiry times (5 to 15 minutes), rate limiting, and one-time use. Combine with SMS for high-security applications.
Can I use OTP for two-factor authentication?
Yes, OTP emails work well for two-factor authentication. Generate a code when the user enters their password, send it via email, and validate it before granting access.
What if the user does not receive the OTP?
Implement a 'resend OTP' button with rate limiting (max 3 attempts per 10 minutes) and offer alternative verification methods like SMS.
Get started in minutes

Start sending with Transmit

Set up in minutes. Volume-based pricing starts at $2/month.