- Best Practices
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
It’s always fun chatting with customers about what they like about Mailgun (and what they’d like to see improved ). We spoke to a customer recently who LOVED that they could schedule delivery of their messages at a specific time in the future. Who knew that this little feature would mean so much to some customers. Today’s blog is about how it works, in case it’s not already part of your workflow.
Some emails needs to be delivered as quickly as possible: error reports, password resets, and welcome emails, for example. Others, however, need to arrive at a particular time to be most effective. For instance, a local restaurant might want to send their daily lunch specials everday at 11 am, so people get it right when their stomachs are starting to growl, but before they’ve chosen a restaurant. The same email received at 4pm is a lot less useful!
Here are some other times that scheduling messages makes sense:
You want your emails delivered to recipients worldwide at a specific time in their local time zone
You want to send an upgrade offer 48 hours after a customer signups for a free trial
You’re leaving on vacation but still want your monthly release notes delivered to your users while you are relaxing on a beach
Mailgun makes this easy with the o:deliverytime parameter which is available when you send email through our API or SMTP.
o:deliverytime is simply a parameter that you specify when sending Mailgun your message. It is set just like to:, from: , subject: and all the other parameters of your email.
Here is what the code could look like to send a single email:
1 def send_scheduled_message(): 2 return requests.post(3 "https://api.mailgun.net/v2/samples.mailgun.org/messages",4 auth=("api", "key-3ax6xnjp29jd6fds4gc373sgvjxteol0"),5 data={"from": "George <me@samples.mailgun.org>",6 "to": "sergeyo@profista.com",7 "subject": "Hello, from the future",8 "text": "No one else is wearing a silver jumpsuit. I feel kinda out of place.",9 "o:deliverytime": "Fri, 25 May 2020 23:10:10 -0000"})
If you want to send different recipients the same email at different times (say at 9am on the East and West Coast), you can using Batch Sending to send up to 1000 recipients in a single API call. Just define the delivery time for each batch when you send it as above. And remember that with Batch Sending, you can use Recipient Variables to personalize each email in the batch with things like First Name, Order Amount, even targeted offers. You can read more about adding Recipient Variables to your emails here.
When scheduling delivery, dates need to be strings encoded according to RFC 2822. This format is native to JavaScript and is also supported by most programming languages out of the box:
'Thu, 13 Oct 2011 18:02:00 GMT'
Finally, there are a lot of factors that affect delivery time including the email content itself which influences how likely ESPs like Gmail and Yahoo are to flag it as spam and delay or prevent delivery. Mailgun will make every effort to deliver your emails as close to your specified time as possible, but can’t guarantee delivery at a specific time. In addition to using o:deliverytime, following our Email Best Practices guide is the best way to make sure your emails get delivered in a timely manner.
Happy emailing, The Mailgunners
Learn about our Deliverability Services
Looking to send a high volume of emails? Our email experts can supercharge your email performance. See how we've helped companies like Lyft, Shopify, Github increase their email delivery rates to an average of 97%.
Last updated on May 17, 2021
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
The Difference Between SMTP and API
The Basics of Email Dark Mode
COVID-19 Survey: How the Pandemic Has Affected Email Sending
The Top Email Clients and Email Apps of 2021
The Benefits of Email Automation
How To Avoid Emails Going To Spam
Which SMTP Port Should I Use? Understanding Ports 25, 465, & 587
The Best Time to Send Holiday Emails - Investigated
Building the Best Email Experience for Creators - Flipsnack’s Story
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Become an Email Pro With Our Templates API
Google Postmaster Tools: Understanding Sender Reputation
Navigating Your Career as a Woman in Tech
Implementing Dmarc – A Step-by-Step Guide
Email Bounces: What To Do About Them
Announcing InboxReady: The deliverability suite you need to hit the inbox
Black History Month in Tech: 7 Visionaries Who Shaped The Future
How To Create a Successful Triggered Email Program
Designing HTML Email Templates For Transactional Emails
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Implementing Dmarc – A Step-by-Step Guide
Announcing InboxReady: The deliverability suite you need to hit the inbox
Designing HTML Email Templates For Transactional Emails
Email Security Best Practices: How To Keep Your Email Program Safe
Mailgun’s Active Defense Against Log4j
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
Email's Best of 2021
5 Ideas For Better Developer-Designer Collaboration
Mailgun Joins Sinch: The Future of Customer Communications Is Here
Always be in the know and grab free email resources!
By sending this form, I agree that Mailgun may contact me and process my data in accordance with its Privacy Policy.