Node.js / JavaScript
const response = await fetch('https://risumail.risu.in/v1/mail/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'you@yourdomain.com',
to: 'recipient@example.com',
subject: 'Hello from Risu Mail!',
html: '<p>This email was sent via Risu Mail API.</p>'
})
});
Python
import requests
response = requests.post(
'https://risumail.risu.in/v1/mail/send',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'from': 'you@yourdomain.com',
'to': 'recipient@example.com',
'subject': 'Hello from Risu Mail!',
'html': '<p>Sent via Risu Mail Python API.</p>'
}
)
PHP
<?php
$payload = [
'from' => 'you@yourdomain.com',
'to' => 'recipient@example.com',
'subject' => 'Hello from Risu Mail!',
'html' => '<p>Sent via Risu Mail PHP API.</p>',
];
$ch = curl_init('https://risumail.risu.in/v1/mail/send');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
cURL
curl --request POST 'https://risumail.risu.in/v1/mail/send' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"from": "you@yourdomain.com",
"to": "recipient@example.com",
"subject": "Hello from Risu Mail!",
"html": "<p>Sent via cURL API call.</p>"
}'