Send an email using the builder.
email_sending.send(EmailSendingSendParams**kwargs) -> EmailSendingSendResponse
POST/accounts/{account_id}/email/sending/send
Send an email using the builder.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Parameters
Send an email using the builder.
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
response = client.email_sending.send(
account_id="account_id",
from_="sender@example.com",
subject="Monthly Report",
to=["recipient@example.com"],
)
print(response.delivered){
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"result": {
"delivered": [
"recipient@example.com"
],
"permanent_bounces": [
"dev@stainless.com"
],
"queued": [
"dev@stainless.com"
]
},
"success": true,
"result_info": {
"count": 0,
"per_page": 0,
"total_count": 0,
"cursor": "cursor",
"page": 0
}
}Returns Examples
{
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"result": {
"delivered": [
"recipient@example.com"
],
"permanent_bounces": [
"dev@stainless.com"
],
"queued": [
"dev@stainless.com"
]
},
"success": true,
"result_info": {
"count": 0,
"per_page": 0,
"total_count": 0,
"cursor": "cursor",
"page": 0
}
}