MailSlurp supports many [sending and receiving](/guides/send-and-receive-email/) methods for email. The job scheduler lets you send emails with a delay or specific send date.

## Send delayed email

To compose an email and send it after a given number of seconds use the scheduled sending methods:



```typescript
await mailslurp.inboxController.sendWithSchedule({
  inboxId: inbox.id,
  sendAtNowPlusSeconds: 5,
  validateBeforeEnqueue: true,
  sendEmailOptions: {
    to: [inbox.emailAddress],
    subject: "test-schedule-123",
    body: "🌭",
  },
});
```



You can also pass an ISO date time to send at like so:



```typescript
try {
  await mailslurp.inboxController.sendWithSchedule({
    // schedule sending 5 second from now
    sendAtTimestamp: new Date(new Date().getTime() + 5000),
    inboxId: inbox.id,
    validateBeforeEnqueue: true,
    sendEmailOptions: {
      to: [inbox.emailAddress],
      subject: "test-schedule-at",
      body: "⏰",
    },
  });
} catch (e) {
  const errorMessage = await e.json();
  throw errorMessage;
}
// now wait for the email to arrive
const expected = await mailslurp.waitController.waitForMatchingFirstEmail({
  inboxId: inbox.id,
  matchOptions: {
    matches: [
      {
        field: MatchOptionFieldEnum.SUBJECT,
        should: MatchOptionShouldEnum.CONTAIN,
        value: "test-schedule-at",
      },
    ],
  },
  timeout: 60_000,
  unreadOnly: true,
});
expect(expected.body).toContain("⏰");
```



## Listing scheduled emails

List the emails that are scheduled for sending with the inbox controller:



```typescript
const inbox = await mailslurp.inboxController.createInboxWithDefaults();
const pageScheduledJobs = await mailslurp.inboxController.getScheduledJobsByInboxId({
  inboxId: inbox.id,
});
expect(pageScheduledJobs.numberOfElements).toEqual(0);
```



## Check schedule statuses

View the job schedule status using the inbox controller:



```typescript
const pageScheduledJobs1 = await mailslurp.inboxController.getScheduledJobsByInboxId({
  inboxId: inbox.id,
});
expect(pageScheduledJobs1.numberOfElements).toEqual(1);
expect(pageScheduledJobs1.content?.[0].status).toEqual("COMPLETED");
```


