Send Email
Authorization<token>
Bearer <API_KEY>
In: header
Header Parameters
Authorizationstring
Bearer <API_KEY>
Data of the email to forward
fromstring
Alias or email address (e.g.: Support <support@mydomain.com>)
Format
"email"
toarray<string>
List of recipients (max. 10)
subjectstring
Email subject
Length
length <= 256
text?string
Plain text body
Length
length <= 50000
html?string
HTML body
Length
length <= 100000
Response Body
curl -X POST "https://api.waxforward.com/dev/send-email" \
-H "Authorization: Bearer 1234abcd" \
-H "Content-Type: application/json" \
-d '{
"from": "alias@example.com",
"to": [
"recipient@example.com"
],
"subject": "Test subject",
"text": "This is a test message.",
"html": "<p>This is a test message.</p>"
}'
const body = JSON.stringify({
"from": "alias@example.com",
"to": [
"recipient@example.com"
],
"subject": "Test subject",
"text": "This is a test message.",
"html": "<p>This is a test message.</p>"
})
fetch("https://api.waxforward.com/dev/send-email", {
headers: {
"Authorization": "Bearer 1234abcd"
},
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.waxforward.com/dev/send-email"
body := strings.NewReader(`{
"from": "alias@example.com",
"to": [
"recipient@example.com"
],
"subject": "Test subject",
"text": "This is a test message.",
"html": "<p>This is a test message.</p>"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "Bearer 1234abcd")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.waxforward.com/dev/send-email"
body = {
"from": "alias@example.com",
"to": [
"recipient@example.com"
],
"subject": "Test subject",
"text": "This is a test message.",
"html": "<p>This is a test message.</p>"
}
response = requests.request("POST", url, json = body, headers = {
"Authorization": "Bearer 1234abcd",
"Content-Type": "application/json"
})
print(response.text)
{
"success": true,
"api_key_id": "1234abcd",
"from": "alias@example.com",
"alias": "alias",
"domain": "example.com",
"sent": [
{
"recipient": "recipient@example.com",
"status": "queued"
}
]
}
{
"errors": [
{
"loc": [],
"msg": "You must provide at least 'html' or 'text' in the email content.",
"type": "value_error"
}
]
}
{
"errors": [
{
"msg": "Invalid or missing API key",
"type": "authorization_error"
}
]
}
{
"errors": [
{
"msg": "Origin not allowed",
"type": "cors_error"
}
]
}
{
"errors": [
{
"msg": "Internal server error",
"type": "internal_error"
}
]
}