Multiple email addresses appearing in To field despite using Mailgun recipient variables for batch emails

I’m having trouble with Mailgun’s batch email feature through SMTP. Even though I’m including recipient variables in my headers, all email addresses are still showing up in the To field for every person who receives the message.

According to Mailgun’s docs, using recipient variables should make each person only see their own email address in the To field. But that’s not happening for me.

Here’s what my SMTP setup looks like:

To: [email protected], [email protected]
X-Mailgun-Recipient-Variables: {
    "[email protected]": {
        "user_id": "789",
        "email": "[email protected]",
        "name": "Alice"
    },
    "[email protected]": {
        "user_id": "101",
        "email": "[email protected]",
        "name": "Bob"
    }
}

The personalization is working fine (names get replaced correctly), but both Alice and Bob can see each other’s email addresses in the To field. What am I doing wrong here?

i had that prob too! u should try using the api for batch sends instead of smtp. it should fix the to field issue. recipient vars can be tricky sometimes, so good luck!

Yeah, this is a known limitation with Mailgun’s SMTP batch sending. When you use SMTP with multiple recipients in the To field, Mailgun handles it differently than their API. The recipient variables work for personalization but don’t hide the To field from other recipients like you’d expect. I ran into this exact issue about six months ago when switching from SendGrid. Fixed it by ditching SMTP and using Mailgun’s HTTP API instead. With the API, you can pass the ‘to’ parameter as an array and recipient variables will properly isolate what each person sees in the To field. You could also send individual SMTP messages in a loop, but that’s way less efficient and kills the whole point of batch sending. The API route keeps it efficient while giving you the privacy control you’re after.

Had the exact same problem when setting up batch emails for customer notifications. Mailgun’s SMTP gateway doesn’t handle recipient isolation like their REST API does. Even with recipient variables, SMTP still shows the To field to everyone - it’s just how email headers work. Spent weeks fighting this before switching to Mailgun’s messages API. Complete game changer - each person only sees their own email address with the API’s batch feature. If you’re stuck using SMTP, you’d have to send individual messages, but that kills the point of batching and you’ll hit rate limits way faster. The API isn’t hard to set up and fixes this privacy issue completely.