What is an Email Sending Domain?

An email sending domain is a domain that you own and configure to send emails from your email marketing campaigns. It serves as the “From” address domain for your emails (e.g., if you send from newsletter@yourdomain.com, then yourdomain.com is your email sending domain).

Why Use Email Sending Domains?

  • Improved Deliverability: ISPs trust emails from verified domains more than generic sending services
  • Brand Recognition: Recipients see emails coming from your branded domain
  • Authentication: Enables proper SPF, DKIM, and DMARC authentication
  • Reputation Building: Builds sender reputation tied to your domain rather than a shared service

Domain Verification Process

Before you can send emails from a domain, it must be verified through DNS records to prove ownership and enable proper email authentication.

Simpu provides APIs to register and manage sending domains via the hooks defined below.

useGetEmailDomains

The useGetEmailDomains hook fetches email domains, allowing you to retrieve a list of domains and their details.

API Reference

Usage

import { useGetEmailDomains } from "@simpu/mail-sdk";

function SendingDomainsPage() {
  const { data, isPending, isError } = useGetEmailDomains();

  if (isPending) {
    return <div>Loading...</div>;
  }

  if (isError) {
    return <div>Error loading sending domains</div>;
  }

  return (
    <div>
      {data.map((domain) => (
        <div key={domain.id}>
          <h3>{domain.domain}</h3>
          <p>Status: {domain.status}</p>
        </div>
      ))}
    </div>
  );
}

useEmailDomains

The useEmailDomains hook manages email domains including creation, verification, and deletion of domains.

Usage

import { useEmailDomains } from "@simpu/mail-sdk";

function SendingDomainsComponent() {
  const { onCreateDomain, onVerifyDomain } = useEmailDomains();

  const handleCreateDomain = async (domainData: { domain: string }) => {
    const result = await onCreateDomain(domainData);
    if (result) {
      console.log("Domain created:", result);
    }
  };
}

Return Values

  • onCreateDomain(payload: { domain: string }) - Creates a new email domain
  • onVerifyDomain(domainId: string) - Verifies an email domain