API Reference

Use the HostFree Email API to deliver custom verification codes generated by your own system. Our infrastructure ensures high deliverability via the Mested SMTP network.

Send OTP Email

Send a custom OTP code to a recipient. This version of the API requires you to provide the otp_code and stores it permanently in our records.

POST https://smtp.mested.com/v1/send.php

Request Parameters

Parameter Type Description
api_key String Your project's unique API key
email String Recipient's valid email address
otp_code String (Required) The custom code you want to send
PHP Implementation
$data = [
    'api_key'  => 'YOUR_API_KEY',
    'email'    => 'user@example.com',
    'otp_code' => '550022' // Your custom code
];

$ch = curl_init('https://mailer.hostfree.site/v1/send.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
echo $response;
Node.js (Axios)
axios.post('https://mailer.hostfree.site/v1/send.php', {
    api_key: 'YOUR_API_KEY',
    email: 'user@example.com',
    otp_code: '998877'
}).then(res => console.log(res.data));

Response Codes

Status Message Description
success Custom OTP sent successfully. Email delivered via Mested SMTP.
error API Key, Valid Email, and OTP Code are required. Missing parameters in the POST request.
error Daily limit reached. Your project has exceeded its 24h quota.