import requests
url = "https://freemail.maev.rocks/send"
payload = {
"api_key": "your_api_key",
"sender_name": "Your Name",
"subject": "Hello from Freemail API",
"message": "This is a test email sent using Freemail API.",
"message_type": "plain",
"receiver_email": "[email protected]"
}
response = requests.post(url, json=payload)
print(response.json())
curl -X POST https://freemail.maev.rocks/send \
-H "Content-Type: application/json" \
-d '{
"api_key": "your_api_key",
"sender_name": "Your Name",
"subject": "Hello from Freemail API",
"message": "This is a test email sent using Freemail API.",
"message_type": "plain",
"receiver_email": "[email protected]"
}'
// Using fetch
const sendEmail = async () => {
const response = await fetch('https://freemail.maev.rocks/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
api_key: 'your_api_key',
sender_name: 'Your Name',
subject: 'Hello from Freemail API',
message: 'This is a test email sent using Freemail API.',
message_type: 'plain',
receiver_email: '[email protected]'
})
});
const data = await response.json();
console.log(data);
};
sendEmail();
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://freemail.maev.rocks/send"
data := map[string]string{
"api_key": "your_api_key",
"sender_name": "Your Name",
"subject": "Hello from Freemail API",
"message": "This is a test email sent using Freemail API.",
"message_type": "plain",
"receiver_email": "[email protected]",
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println("Response:", string(body))
}
use reqwest::Client;
use serde_json::json;
use tokio;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let url = "https://freemail.maev.rocks/send";
let payload = json!({
"api_key": "your_api_key",
"sender_name": "Your Name",
"subject": "Hello from Freemail API",
"message": "This is a test email sent using Freemail API.",
"message_type": "plain",
"receiver_email": "[email protected]"
});
let response = client
.post(url)
.header("Content-Type", "application/json")
.json(&payload)
.send()
.await?;
println!("Response: {:?}", response.text().await?);
Ok(())
}