Back to main menu


Tips and tricks for scheduling email delivery

Want to schedule emails for a later time? Learn how to do it with Mailgun’s Email API.



Picture this: You're on vacation, but your email marketers don't want to miss the optimal window to send an email to your subscribers. They need you to get the email out, but between the margaritas, you really don't want to be thinking about work.

At Mailgun, we've got you covered. Schedule your email campaigns with ease using our Email API so your marketing team stays happy with optimized send times. Below, we'll look at the benefits of scheduling email deliveries, then we'll go through a tutorial on how to schedule email messages with Mailgun.

What are the benefits of scheduling email delivery for a particular time?

While some emails need to be delivered as quickly as possible, like error reports, password resets, and welcome emails, other emails should be sent at a scheduled time to be most effective.

For instance, a tech hardware website might want to send their daily deals every day at 8:45 AM, so their customers receive it right when they check their emails before settling into the work grind. The same email is a lot less useful at 5 PM when their subscribers can’t wait to get off of work.

The benefits of scheduling send times are:

  • Avoid time zone issues: With a scheduled send, you can deliver your email to your subscribers at the appropriate time across different time zones. Instead of sending an email to everyone at your 7 PM (which may be the morning for your subscribers), you can schedule your email to delay delivery until their 7 PM.

  • Optimize send times to target conversions: Emails sent out on a Friday might be lost as people rush to leave the office. You can use what you know about your users to pick the optimal times to email your subscribers and entice them to click through to your content.

  • Optimize send times for you: You have a life, too. We understand. And sometimes, you'd rather not work on the weekends even if studies say that's the best time to reach your subscribers. Compose and schedule emails ahead of time to send when you aren't working.

  • Create consistency: Using the schedule email delivery feature gives you a leg up on sending out emails on a regular schedule in order to keep data consistent and conversions up.

Similar to email automation, scheduled email deliveries are just the next step to enable us to do more in less time – and that works for us.

How do I schedule email deliveries to send later?

Let's see how Mailgun’s Email API squares up to the task if you're looking to optimize your scheduled email deliveries. In the following tutorial, we'll go over how to use the messages endpoint of our Mailgun API to schedule an email blast.

You can adjust to code below with your own details, like your API key and domain name, to send a POST request to the Mailgun API to compose a new email and schedule it for later:

The above request includes the following parameters:

  • to (required): Supply one or more email recipient(s) in the to parameter. This parameter can take a list of emails separated by commas. Check out our documentation on batching and mailing lists for ways to send large email blasts to many recipients.

  • from (required): The from parameter indicates the sender of your email.

  • subject : Supply your email's subject line in the subject parameter.

  • text : The text parameter is a plaintext message you can include in the body of your email.

  • html : The html parameter allows you to insert HTML into the body of your email by pasting it between the <html> tags. Remember, you can also upload your HTML email template using our Templates API and use the template parameter to call it in this request.

  • o:deliverytime (required): The o:deliverytime parameter is probably the most important part of this API request. This parameter is available when you send emails through our API or SMTP. Use this parameter to specify when you'd like Mailgun to send your message.

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:

How do I schedule emails to be sent to my subscribers based on their local time zone?

In the tutorial above, we mentioned that it's possible to include a list of emails in the to parameter. Of course, this gets unwieldy when you're trying to send an email marketing campaign to 1000 recipients spread across different time zones.

That's why we created the Time Zone Optimization functionality. Mailgun’s Timezone Optimization feature allows senders to schedule messages to be delivered in a recipient’s local timezone.

When will Mailgun deliver my scheduled message?

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. After all, there are a lot of factors that affect delivery time, including the email content itself. These factors influence how likely email clients like Gmail and Yahoo are to flag it as spam and delay or prevent delivery.

Wrapping up

And that's it! Sip that margarita and keep your email marketers happy as your emails land in your subscribers' inboxes.

In addition to using o:deliverytime, check out our Email Best Practices to make sure your emails get delivered on time. Or, if you're working with Node.JS, take a peek at our tutorial for scheduling email deliveries. As always, make sure to keep email accessibility in mind.

Don't hesitate to reach out if you have any questions about how Mailgun can support you. We're here to help you send all your emails whenever you need them.

Sign Up

It's easy to get started. And it's free.

See what you can accomplish with the world’s best email delivery platform.

Related readings

SMTP v. API: Their differences and how to use them

You’re tasked with integrating email into the app you’re building or the customer relationship management (CRM) tool your business uses. You have two choices: SMTP or...

Read more

The basics of email dark mode

We all know that light tends to win over dark. Just look at Star Wars or Lord of the Rings… or The Divine Comedy, for that matter. Pop culture – or just culture, really – has taught us...

Read more

Scheduled email delivery with Mailgun and Node.js

This is an updated version of the post “Scheduled Email Delivery With Mailgun And Node.Js” written by Timothy Voice, a Brooklyn...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

See what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon