# MailPitContainerResource

- Kind: `class`
- Package: [CommunityToolkit.Aspire.Hosting.MailPit](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.MailPit/MailPitContainerResource.cs)
- Inherits: `ContainerResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IValueProvider`, `IValueWithReferences`

Resource for the MailPit server.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class MailPitContainerResource
    : Aspire.Hosting.ApplicationModel.ContainerResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `CommunityToolkit.Aspire.Hosting.MailPit/MailPitContainerResource`

## Constructors

- [MailPitContainerResource(string)](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/constructors.md#constructor-string) -- Resource for the MailPit server.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- ConnectionString for MailPit smtp endpoint in the form of smtp://host:port.
- [Host](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/properties.md#host) : `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for the SMTP endpoint.
- [Port](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/properties.md#port) : `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for the SMTP endpoint.
- [PrimaryEndpoint](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/properties.md#primaryendpoint) : `EndpointReference` `get` -- Gets the primary SMTP endpoint for the MailPit server.
- [UriExpression](/reference/api/csharp/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the MailPit SMTP endpoint.
