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 still appear in the To field for every person who receives the message.
According to MailGun’s docs, using recipient variables should make each person get their own individual email with only their address in the To field. But that’s not happening for me.
The variables are getting replaced correctly in the email content, but both recipients can see each other’s email addresses. What am I doing wrong here?
Yeah, this totally caught me off guard too. The docs make it sound like SMTP handles recipient variables just fine, but there’s a key limitation they don’t explain well. SMTP works with standard email headers - the To field shows all recipients by design. MailGun’s recipient variables only work through their API because their backend needs to process and split messages before sending. When you use SMTP, MailGun gets one email with multiple recipients in the To header. Sure, they’ll replace variables in the content, but they can’t hide recipients from each other since that would mean rebuilding the entire message. You’ve got two options: switch to their REST API for proper batch sending, or deal with the performance hit of individual SMTP messages. I kept SMTP for transactional stuff but moved bulk sends to the API just for this reason.
same thing happend 2 me when I started with Mailgun. SMTP cant hide recipents from each other - thats just how email works. recipient variables only replace content, they dont hide addresses. you’ll need to either send indiviual emails in a loop or use their API for proper batch sends.
Been there, done that. Everyone’s right about SMTP limitations, but debugging MailGun’s quirks and switching between SMTP and API calls? Total waste of time.
Hit this exact problem building our customer onboarding system. Spent way too long trying to make MailGun’s batch sending work across different scenarios.
Finally said screw it and switched to Latenode. Handles batch emails properly from day one. Upload your recipient list, build your template with variables, and it sends individual emails automatically.
No SMTP vs API headaches. No recipient visibility problems. You get solid error handling and retry logic without writing any code.
Saved me 20+ hours of debugging and gave me much better delivery tracking.
Had this exact issue migrating from SendGrid to MailGun last month. The problem? SMTP doesn’t support MailGun’s recipient variable isolation at all. When you send via SMTP, it treats everything as one message with multiple recipients - the X-Mailgun-Recipient-Variables header gets ignored.
MailGun’s recipient variables only work through their REST API, not SMTP. The API creates separate messages for each recipient, so people only see their own address in the To field.
If you’re stuck with SMTP, you’ll have to send individual messages in a loop instead of batch sending. It’s not great for performance, but it gives you the privacy you need. Otherwise, you’ll need to refactor your code to use MailGun’s API directly.
Yeah, this is a classic MailGun SMTP trap. You can’t use SMTP for proper recipient variables - you need their API instead.
SMTP just dumps everyone in the To field like a regular email, so all recipients see each other. For true batch sending where people only see their own email, you’ve got to hit MailGun’s messages endpoint directly.
But managing all those API calls and handling failures? Total pain.
I hit this same wall last year building a newsletter system. Instead of fighting MailGun’s quirks, I just moved everything to Latenode. It handles the recipient logic automatically and sends individual emails through whatever provider you pick.
Upload your list, set up your template with variables, done. Latenode processes each email separately. No more recipient visibility issues, plus you get delivery tracking and retry logic without the headache.
Way better than debugging SMTP headers and API differences.