# OutboxExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/)

## Send(IOutbox, MessageType&lt;T&gt;, IEnumerable&lt;MessageId MessageId, GrainId Destination, T Body)&gt;) {#send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-ba04d009}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/methods/send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-ba04d009/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/OutboxExtensions.cs#L69-L82)

```csharp
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, IEnumerable<(MessageId MessageId, GrainId Destination, T Body)> messages)
```

Encodes and synchronously stages typed commands in enumeration order.

### Parameters

- `outbox` (`IOutbox`): The owning grain's outbox.
- `messageType` (`MessageType<T>`): The subject and serializer binding.
- `messages` (`IEnumerable<MessageId MessageId, GrainId Destination, T Body)>`): The application-defined identities, destinations, and bodies.

## Send(IOutbox, MessageType&lt;T&gt;, MessageId, GrainId, T, DateTimeOffset?) {#send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-e5cc4540}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/methods/send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-e5cc4540/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/OutboxExtensions.cs)

```csharp
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, MessageId messageId, GrainId destination, T body, DateTimeOffset? deliverAt = null)
```

Encodes and synchronously stages one typed command.

### Parameters

- `outbox` (`IOutbox`): The owning grain's outbox.
- `messageType` (`MessageType<T>`): The subject and serializer binding.
- `messageId` (`MessageId`): The stable application command identity.
- `destination` (`GrainId`): The destination inbox.
- `body` (`T`): The body to encode.
- `deliverAt` (`DateTimeOffset?`): The optional earliest time, on the Durable Jobs clock, at which the receiving inbox processes the message. The outbox still delivers the message immediately. See [Envelope](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.envelope/).

## Send(IOutbox, MessageType&lt;T&gt;, MessageId, IAddressable, T, DateTimeOffset?) {#send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-24e09cad}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/methods/send-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-messaget-24e09cad/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/OutboxExtensions.cs)

```csharp
public static void Send<T>(this IOutbox outbox, MessageType<T> messageType, MessageId messageId, IAddressable destination, T body, DateTimeOffset? deliverAt = null)
```

Encodes and synchronously stages one typed command to a grain reference.

### Parameters

- `outbox` (`IOutbox`): The owning grain's outbox.
- `messageType` (`MessageType<T>`): The subject and serializer binding.
- `messageId` (`MessageId`): The stable application command identity.
- `destination` (`IAddressable`): The destination grain.
- `body` (`T`): The body to encode.
- `deliverAt` (`DateTimeOffset?`): The optional earliest time, on the Durable Jobs clock, at which the receiving inbox processes the message. The outbox still delivers the message immediately. See [Envelope](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.envelope/).

## SendReply(IOutbox, MessageType&lt;T&gt;, IInboxHandlerContext, GrainId, T) {#sendreply-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-mes-0298cbd8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/methods/sendreply-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-mes-0298cbd8/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/OutboxExtensions.cs)

```csharp
public static void SendReply<T>(this IOutbox outbox, MessageType<T> messageType, IInboxHandlerContext context, GrainId destination, T body)
```

Encodes and stages a reply under the received command's deterministic result child.

### Parameters

- `outbox` (`IOutbox`): The replying grain's outbox.
- `messageType` (`MessageType<T>`): The reply subject and serializer binding.
- `context` (`IInboxHandlerContext`): The current received message and completion context.
- `destination` (`GrainId`): The application-selected reply destination.
- `body` (`T`): The reply body.

## SendReply(IOutbox, MessageType&lt;T&gt;, IInboxHandlerContext, IAddressable, T) {#sendreply-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-mes-3294af53}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.outboxextensions/methods/sendreply-1-this-orleans-durable-messaging-ioutbox-orleans-durable-messaging-mes-3294af53/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/OutboxExtensions.cs)

```csharp
public static void SendReply<T>(this IOutbox outbox, MessageType<T> messageType, IInboxHandlerContext context, IAddressable destination, T body)
```

Encodes and stages a deterministic result reply to a grain reference.

### Parameters

- `outbox` (`IOutbox`): The replying grain's outbox.
- `messageType` (`MessageType<T>`): The reply subject and serializer binding.
- `context` (`IInboxHandlerContext`): The current received message and completion context.
- `destination` (`IAddressable`): The application-selected replying grain reference.
- `body` (`T`): The reply body.
