Mailgun: An Email-Sending Alternative for Access Developers
For VBA developers grappling with the looming specter of "New Outlook" and Microsoft's general disdain for COM automation, Mailgun offers an intriguing alternative.
To foist or not to foist?
When it comes to Microsoft, that’s never really a question—they’ll always choose foist. Just ask your neighborhood VB6 developer, still nursing the scars from Microsoft’s last big foist—the great .NET migration of 2002.
Well, they’re at it again.
Come January 2025, Microsoft will foist the electronic mail abomination that is New Outlook upon its Microsoft 365 Business subscribers. And as if that weren’t enough, they’ll also be dumping a significant amount of extra work on VBA developers. If you’re both an MS 365 subscriber and an Access developer, prepare to be double-foisted—and you’ll feel it good and hard when New Outlook breaks your automations overnight.
If being foisted upon doesn’t sound like your idea of fun, you can stick with Classic Outlook (and its beloved COM automation support) through at least 2029. But if you’re one of the rare souls who enjoys a good foisting (no judgment here), you’ll need an alternative to Outlook COM Automation—and you’ll need it soon.
One alternative to consider is Mailgun, which offers a modern, COM-free approach to email automation (but will fit some use cases better than others).
Why Mailgun?
Mailgun offers a developer-friendly email service that eliminates dependencies on local email clients.
Instead of relying on Outlook automation, your Access applications can send emails directly through Mailgun's API using standard VBA and the MSXML2.ServerXMLHTTP object. This means no more wrestling with Outlook security prompts, MAPI profiles, or COM references.
How It Works
Your Access application makes simple HTTP POST requests to Mailgun's API endpoint. The service handles all the complex parts of email delivery, including:
- Message queuing and retry logic
- Bounce handling
- Delivery tracking
- Email authentication (SPF, DKIM)
- Anti-spam compliance
Capabilities
Mailgun supports all the common email scenarios Access developers typically handle:
- Plain text and HTML emails
- Multiple file attachments
- Scheduled message delivery
- Email templates
- Delivery tracking and statistics
Simple Pricing
Mailgun's tiered pricing structure accommodates various development scenarios:
- Testing Tier: Up to 100 emails daily at no cost
- Basic Tier: 10,000 monthly emails with one custom domain for $15/month
- Foundation Tier: 50,000 monthly emails with up to 1,000 sending domains for $35/month
The Basic tier suits most in-house Access developers, while the Foundation tier provides agencies and freelancers a scalable solution for multiple clients.
Implementation Benefits
Beyond replacing Outlook automation, Mailgun offers several advantages:
- No client-side email software requirements
- Reliable delivery with professional-grade infrastructure
- Detailed delivery tracking and analytics
- Simple API integration using standard VBA
- Support for modern email authentication standards
Limitations
Email Volume Restrictions
- New accounts have a 100 emails/hour limit during probation period
- Free accounts require authorized recipients for testing
- Sandbox domains always require authorized recipient validation
Technical Constraints
- No direct draft email creation capabilities
- Cannot integrate with Outlook's draft folder
- Limited HTML/CSS support compared to dedicated email design tools
- No direct preview in email clients before sending
Sending Domain Requirements
- Domain verification required before sending
- DNS configuration needed (SPF, DKIM records)
- Custom domains require account upgrade beyond free tier
- Proper DNS propagation can take up to 24 hours
API Restrictions
- Rate limiting applies based on plan tier
- API calls count against monthly email quota
- Webhook setup required for detailed tracking
- Email retention limited to 3 days by default
In my mind, the biggest potential downside is the lack of support for creating draft emails that can be edited in Outlook before sending. That said, this is likely to be a major limitation for any of the non-COM alternatives.
Making the Switch
Watch this blog for upcoming articles with detailed VBA code samples and step-by-step guides on how to implement Mailgun in your Access applications.
Acknowledgements
- Portions of this article's body generated with the help of Perplexity AI
- Cover image generated by FLUX-schnell