Platform
Chatbot Builder Bulk Messaging Team Inbox Mini CRM API & Webhooks AI Integration WhatsApp Flows
Industries
E-commerce & D2C Real Estate Education Healthcare Finance & BFSI Logistics Hospitality Retail
Integrations
Learn
Learning Hub Help & Docs Connect Guides Automation Codex Blog Message Templates
Pricing Start Free Trial →
HomeConnect › Send Email from WhatsApp
Email / SMTP Integration Guide · Marketing / Email

Send Email from a WhatsApp Automation

Trigger a transactional email from any WhatsApp conversation: an order confirmation, a receipt, a password reset, or a copy of an enquiry to your team. The trick is using an email API instead of raw SMTP, and this guide shows you exactly how.

Published 23 June 2026  ·  7 min read  ·  Marketing / Email

Before following this guide, read the External API Request step foundation guide. It covers every field in the step interface so this guide can focus on email-specific values.

You cannot use raw SMTP; use an email API instead

WA.Expert's External API Request step speaks HTTP, not the SMTP protocol. Raw SMTP needs a persistent socket on a port like 587 or 465, which an HTTP request cannot open. The solution: use a transactional email API (MailerSend, SendGrid, or Mailgun). These accept a simple HTTP POST and send the email for you. This guide uses MailerSend as the primary example (free tier: 500 emails/month), with SendGrid and Mailgun in the reference section.

Step 1: Verify a sending domain and create a token

1
Sign up at mailersend.com. Go to Domains and add your sending domain (e.g. yourcompany.com).
2
Add the DNS records MailerSend gives you (SPF, DKIM) to your domain registrar and wait for verification. This proves you own the domain and is required to send.
3
Once verified, click Manage next to the domain, scroll to API tokens, and click Create token. Copy it immediately.
4
Your token is used as a Bearer token: Authorization: Bearer YOUR_TOKEN.
The from address must be on a verified domain

You can only send from a domain you have verified. Sending from noreply@yourcompany.com works once yourcompany.com is verified. Trying to send from a generic address like yourname@gmail.com will fail with a 422 error, because providers block unverified domains to prevent spoofing.

Official docs

MailerSend Email API: developers.mailersend.com

Step 2: Build the External API Request step

In your WhatsApp automation, after the trigger that should send the email (an order placed, a form completed, a keyword), add an External API Request step:

External API Request Step · WA.Expert
Select Method
POST
Request URL
https://api.mailersend.com/v1/email
Select Auth Type
No Auth (Authorization Bearer below)
Header Parameters
AuthorizationBearer YOUR_MAILERSEND_API_TOKEN
Content-Typeapplication/json
Select Body Type
JSON
Body
{{"from":{{"email":"noreply@yourcompany.com","name":"Your Company"}},"to":[{{"email":"{{{{customer_email}}}}","name":"{{{{customer_name}}}}"}}],"subject":"Thanks for your order, {{{{customer_name}}}}!","text":"Hi {{{{customer_name}}}}, we have received your order. ..."}}
Choose Response Type
JSON (HTTP 202 on success)
POST /v1/email body and response
Body:
{{
  "from": {{
    "email": "noreply@yourcompany.com",
    "name":  "Your Company"
  }},
  "to": [
    {{"email": "{{customer_email}}", "name": "{{customer_name}}"}}
  ],
  "subject": "Thanks for your order, {{customer_name}}!",
  "text":    "Hi {{customer_name}}, we have received your order.",
  "html":    "

Hi {{customer_name}}, we have received your order.

" }} Response: HTTP 202 Accepted (empty body) Header: X-Message-Id: 5e42957d51f1d94a1070a733 202 means the email was accepted for delivery. Provide at least one of text or html (both is best).

Field-by-field breakdown

FieldValueNotes
Select MethodPOSTSending an email is always a POST.
Request URLhttps://api.mailersend.com/v1/emailThe MailerSend send endpoint.
AuthorizationBearer YOUR_TOKENYour API token from Step 1, after 'Bearer '.
Content-Typeapplication/jsonRequired for the JSON body.
from.emailnoreply@yourcompany.comMust be on a verified domain.
to[].email{{customer_email}}WhatsApp variable for the recipient.
subjectYour subject with {{variables}}Personalise with WhatsApp variables.
text / htmlEmail bodyProvide text, html, or both. Both is recommended.
202 Accepted is success

MailerSend returns HTTP 202 Accepted, not 200, when an email is queued for delivery. The response body is empty; the X-Message-Id response header confirms the send. Branch your flow on the 202 status.

Worked example: order confirmation email

Automation flow: send order confirmation from WhatsApp
Trigger: Customer completes checkout in a WhatsApp commerce flow.

Captured: {{customer_email}} = priya@example.com
          {{customer_name}}  = Priya Sharma
          {{order_id}}       = ORD-4821
          {{order_total}}    = Rs. 2,499

External API Request step:
POST https://api.mailersend.com/v1/email
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

Body:
{{
  "from": {{"email": "orders@yourcompany.com", "name": "Your Store"}},
  "to":   [{{"email": "priya@example.com", "name": "Priya Sharma"}}],
  "bcc":  [{{"email": "sales@yourcompany.com"}}],
  "subject": "Order ORD-4821 confirmed — Rs. 2,499",
  "html": "

Hi Priya, your order ORD-4821 is confirmed.

" }} Response: HTTP 202, X-Message-Id returned Result: - Priya gets an order confirmation email instantly - Your sales team gets a silent bcc copy - The WhatsApp bot continues with delivery details
Send to the customer and your team at once

Use the bcc array to send a silent copy to your team. The customer sees only their own address in the to field; your team gets notified without the customer seeing the internal address.

Reference: SendGrid and Mailgun

Prefer a different provider? The pattern is identical, only the endpoint, auth, and body shape change. Here are the two most common alternatives.

SendGrid — POST /v3/mail/send
POST https://api.sendgrid.com/v3/mail/send
Authorization: Bearer YOUR_SENDGRID_API_KEY
Content-Type: application/json

Body:
{{
  "personalizations": [
    {{"to": [{{"email": "{{customer_email}}"}}]}}
  ],
  "from": {{"email": "noreply@yourcompany.com"}},
  "subject": "Thanks for your order!",
  "content": [
    {{"type": "text/plain", "value": "Hi {{customer_name}}, ..."}}
  ]
}}

Response: HTTP 202 Accepted
Note: SendGrid wraps recipients in a personalizations array.
Mailgun — POST /v3/{{domain}}/messages
POST https://api.mailgun.net/v3/yourcompany.com/messages
Authorization: Basic BASE64('api:YOUR_MAILGUN_API_KEY')
Content-Type: application/x-www-form-urlencoded

Body (form-encoded, not JSON):
  from=noreply@yourcompany.com
  to={{customer_email}}
  subject=Thanks for your order!
  text=Hi {{customer_name}}, we have received your order.

Response: HTTP 200 with a JSON body containing a message id
Note: Mailgun uses Basic Auth (username 'api') and form-encoded
body, not JSON. The domain is in the URL path.
ProviderAuthBody formatSuccess code
MailerSendBearer tokenJSON202 Accepted
SendGridBearer tokenJSON (personalizations array)202 Accepted
MailgunBasic Auth (api:key)form-encoded200 OK

All three work from the External API Request step. MailerSend has the simplest JSON body and a generous free tier, which is why this guide uses it as the default.

Troubleshooting

SymptomLikely causeFix
422 on from addressSending domain not verifiedVerify your domain in the provider dashboard (add SPF and DKIM DNS records). Use a from address on that verified domain.
401 UnauthorizedWrong or missing API tokenCheck the Authorization header is 'Bearer YOUR_TOKEN'. Regenerate the token if needed.
422 about recipientsMalformed to arrayThe to field must be an array of objects: [{email: '...'}]. Ensure the customer email variable resolved to a real address.
Email sent but not receivedLanded in spam or suppressedCheck the provider's activity log. Ensure SPF/DKIM are set. A previously bounced or unsubscribed address may be suppressed.
Trying to connect via SMTP portUsing raw SMTP instead of the APIThe External API Request step cannot open SMTP ports. Use the provider's HTTP email API endpoint as shown above.
202 but want confirmation202 is the success code202 Accepted means the email was queued. Use the X-Message-Id header to track it in the provider's activity log.

Common questions

Can I use raw SMTP from a WhatsApp automation?
+
No. The External API Request step uses HTTP, not SMTP. Raw SMTP needs a socket connection on ports like 587/465. Use an email API (MailerSend, SendGrid, Mailgun) with an HTTP endpoint instead.
Which email API should I use?
+
Any with an HTTP endpoint. MailerSend is a clean default with a 500/month free tier and simple JSON. SendGrid and Mailgun also work; see the reference section.
Why the 422 error on the from address?
+
Your sending domain is not verified. Add and verify the domain (SPF + DKIM) in the provider dashboard, then send from an address on that domain.
What is the MailerSend send endpoint?
+
POST https://api.mailersend.com/v1/email with Authorization Bearer. Body needs from, to, subject, and text or html. Returns HTTP 202 on success.
Can I copy my team on the email?
+
Yes. Add multiple recipients to the to array, or use cc and bcc arrays. bcc sends a silent copy your customer cannot see.
Does this incur extra WA.Expert charges?
+
One automation action per External API Request call. Included on the Complete plan. Starter: from Rs. 49 per 1,000 actions. Email providers have their own pricing; MailerSend includes 500 emails/month free.

Connect Mailchimp to WhatsApp

Mailchimp: add WhatsApp opt-ins to your email marketing lists.

Read guide →

Connect Brevo to WhatsApp

Brevo: contact sync and transactional email from WhatsApp.

Read guide →

External API Request Step

Master every field in WA.Expert's HTTP action step.

Read foundation guide →

Send email from WhatsApp today

Free trial, no credit card. If you get stuck, we answer live on WhatsApp.

Start Free Trial → Book a Demo
1