> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailofly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Schedule Email

> Schedule transactional emails for future dispatch up to 72 hours ahead.

# Schedule Email

Schedule emails to be sent at a future date and time up to **72 hours in advance**.

This allows you to coordinate product announcements, schedule reminders during business hours in the recipient's timezone, or delay onboarding emails without managing your own cron workers.

***

## Scheduling via the API

Include the `scheduled_at` parameter formatted as an **ISO-8601 string**:

```typescript theme={null}
import { Mailofly } from "mailofly";

const mailofly = new Mailofly("mfly_live_your_api_key");

// Schedule send for tomorrow at 9:00 AM UTC
const tomorrowAtNine = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString();

const { data } = await mailofly.emails.send({
  from: "Team <team@acme.com>",
  to: ["user@example.com"],
  subject: "Product Launch Alert!",
  html: "<p>We just launched v2.0!</p>",
  scheduled_at: tomorrowAtNine,
});

console.log("Scheduled message ID:", data.id);
```

***

## Modifying or Cancelling Scheduled Emails

Before the `scheduled_at` timestamp arrives, you can cancel the pending email:

```http theme={null}
DELETE https://api.mailofly.com/api/emails/:id/cancel
Authorization: Bearer <YOUR_API_KEY>
```

```typescript theme={null}
await mailofly.emails.cancel("msg_01J8G52XYZ9A8B7C6D");
```

Once cancelled:

* The status in **Activity Logs** updates to `cancelled`.
* The message will not be dispatched to the recipient.
* No sending credits are consumed for cancelled messages.


## Related topics

- [Email types](/getting-started/email-types.md)
- [How do Dedicated IPs work?](/guides/sending/how-do-dedicated-ips-work.md)
- [Introduction](/broadcasts/introduction.md)
- [Manage Broadcasts](/broadcasts/manage-broadcasts.md)
