Deliverability•3 min read

Why Sending Transactional Emails from a Subdomain Boosts Deliverability

Learn how using a dedicated sending subdomain like mail.example.com can isolate your email reputation, protecting critical transactional emails from marketing campaign issues and improving overall deliverability.

Why Sending Transactional Emails from a Subdomain Boosts Deliverability

Section 1

The Strategic Advantage of a Sending Subdomain

When you send emails, your domain builds a reputation with mailbox providers. This reputation directly impacts whether your emails land in the inbox or the spam folder. Mixing marketing and transactional emails from your main domain (e.g., example.com) means that a single issue, like a poorly performing marketing campaign, can negatively affect the deliverability of crucial transactional emails such as password resets or order confirmations. Using a dedicated sending subdomain, like mail.example.com, allows you to isolate email reputation, ensuring your critical communications remain unaffected by other email streams.

Section 2

Configuring Your Subdomain for Optimal Deliverability with Piisend

To leverage a sending subdomain, you'll need to configure its DNS records correctly. This involves setting up SPF, DKIM, and DMARC records specifically for your chosen subdomain (e.g., mail.example.com). Piisend provides the necessary DNS entries to ensure custom domain authentication, which is vital for establishing trust with email providers. Once verified, you can specify your subdomain in the From address of your emails. This clear alignment between the sending domain and the From address is a strong signal of legitimacy to receiving servers.

Section 3

Sending Emails from Your Verified Subdomain with Piisend

After your subdomain is verified in Piisend, sending emails from it is straightforward. Simply ensure that the From address in your API request uses your verified subdomain. This tells Piisend to send the email using the dedicated reputation and authentication of mail.example.com, rather than your main domain. Below is an example using curl to send a password reset email from a subdomain.

bash
1curl -X POST https://api.piisend.com/api/v1/emails \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "from": "password-reset@mail.example.com",
6 "to": ["user@example.com"],
7 "subject": "Your Piisend Password Reset Link",
8 "html": "<p>Click <a href=\"https://your-app.com/reset?token=123\">here</a> to reset your password.</p>",
9 "text": "Click this link to reset your password: https://your-app.com/reset?token=123"
10 }'

Section 4

Python Example: Sending from a Subdomain

Integrating subdomain sending into your application logic is simple. Here's how you can send an order confirmation email using the Piisend Python client, ensuring the From address utilizes your dedicated sending subdomain. This approach helps maintain a strong sender reputation for your critical transactional messages.

python
1import requests
2
3def send_order_confirmation(recipient_email, order_id):
4 api_key = "YOUR_API_KEY"
5 url = "https://api.piisend.com/api/v1/emails"
6 headers = {
7 "Authorization": f"Bearer {api_key}",
8 "Content-Type": "application/json"
9 }
10 payload = {
11 "from": "orders@mail.example.com",
12 "to": [recipient_email],
13 "subject": f"Your Order #{order_id} Confirmation",
14 "html": f"<p>Thank you for your order! Your order number is <strong>{order_id}</strong>.</p>",
15 "text": f"Thank you for your order! Your order number is {order_id}."
16 }
17 response = requests.post(url, headers=headers, json=payload)
18 response.raise_for_status()
19 print(f"Email sent successfully for order {order_id}")
20
21# Example usage:
22send_order_confirmation("customer@example.com", "PII-2024-12345")

Section 5

Maintaining a Healthy Subdomain Reputation

Even with a dedicated sending subdomain, continuous monitoring and adherence to best practices are essential for maintaining a healthy sender reputation. Regularly check your Piisend delivery logs for any bounces or complaints specific to your subdomain. Ensure your email content is relevant, timely, and expected by recipients. Implementing a List-Unsubscribe header for non-transactional emails sent from the subdomain (if any) can also help manage recipient engagement and prevent spam complaints, further bolstering your subdomain's standing with mailbox providers.

Start sending

Ship transactional email in minutes

Create an API key, verify a domain, and send your first message with Piisend.