Sending Domains
Add and verify your own domain for outbound email. MailAfrica provisions a dedicated sending agent, gives you DKIM/CNAME records, and lets you create from-addresses.
Send from your own domain with full DKIM signing. When you add a domain, MailAfrica provisions a dedicated sending agent and returns the DNS records you publish — once they verify, sends through that domain use your own dedicated SMTP path.
Add a sending domain
curl -X POST https://api.mailafrica.online/api/domains/ \
-H "X-API-Key: MAIL_<your_api_key_here>" \
-H "Content-Type: application/json" \
-d '{"domain": "yourcompany.co.tz", "from_local_part": "noreply"}'from_local_part (default noreply) is the default from-address for the domain. The response includes the DNS records to publish:
{
"success": true,
"data": {
"domain": {
"id": 2,
"domain": "yourcompany.co.tz",
"purpose": "sending",
"status": "pending",
"from_local_part": "noreply",
"created_at": "2026-08-15T00:00:00Z"
},
"dns_records": [
{ "type": "TXT", "host": "<dkim-host>", "value": "<public-key>" },
{ "type": "CNAME", "host": "<cname-host>", "value": "<cname-target>" }
]
}
}Verify the domain
curl -X POST https://api.mailafrica.online/api/domains/2/verify \
-H "X-API-Key: MAIL_<your_api_key_here>"Publish the TXT (DKIM) and CNAME records, then re-check. Status transitions pending → verified (or failed if records are wrong). verified_at is set once confirmed.
Create sender addresses
Each verified sending domain gets its default local part (e.g. noreply@yourcompany.co.tz) automatically. Add up to 100 additional from-addresses per account:
curl -X POST https://api.mailafrica.online/api/domains/2/senders \
-H "X-API-Key: MAIL_<your_api_key_here>" \
-H "Content-Type: application/json" \
-d '{"local_part": "billing"}'You can then send as billing@yourcompany.co.tz by passing from_domain_id and from_address on the outbound call. Any other from-address is rejected with 400 — only the domain default and recorded senders are allowed.
List & delete
# List sending domains
curl https://api.mailafrica.online/api/domains/ \
-H "X-API-Key: MAIL_<your_api_key_here>"
# List all sender addresses
curl https://api.mailafrica.online/api/domains/senders \
-H "X-API-Key: MAIL_<your_api_key_here>"
# Delete a sender address
curl -X DELETE https://api.mailafrica.online/api/domains/senders/99 \
-H "X-API-Key: MAIL_<your_api_key_here>"
# Delete a sending domain
curl -X DELETE https://api.mailafrica.online/api/domains/2 \
-H "X-API-Key: MAIL_<your_api_key_here>"From addresses as spam, and DKIM is enforced under your own domain.