# MailPitContainerResource

- Module: [CommunityToolkit.Aspire.Hosting.MailPit](/reference/api/typescript/communitytoolkit.aspire.hosting.mailpit.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

Resource for the MailPit server.

## Definition

```typescript
interface MailPitContainerResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly host: EndpointReferenceExpression;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly uriExpression: ReferenceExpression;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): MailPitContainerResource;
  withDataVolume(
      name: string,
      isReadOnly?: boolean): MailPitContainerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- ConnectionString for MailPit smtp endpoint in the form of smtp://host:port.
- `host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for the SMTP endpoint.
- `port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for the SMTP endpoint.
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the primary SMTP endpoint for the MailPit server.
- `uriExpression`: `ReferenceExpression` `get` -- Gets the connection URI expression for the MailPit SMTP endpoint.

## Methods

- [withDataBindMount](/reference/api/typescript/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/withdatabindmount.md) -- `method` -- Configures a bind mount for the data directory of the MailPit container resource.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): MailPitContainerResource
  ```
- [withDataVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/withdatavolume.md) -- `method` -- Configures a data volume for the MailPit container resource.
    ```typescript
  withDataVolume(name: string, isReadOnly?: boolean): MailPitContainerResource
  ```
