# MailPitContainerResource

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

Resource for the MailPit server.

## Definition

```go
type MailPitContainerResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## 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/go/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/withdatabindmount.md) -- `method` -- Configures a bind mount for the data directory of the MailPit container resource.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) MailPitContainerResource
  ```
- [WithDataVolume](/reference/api/go/communitytoolkit.aspire.hosting.mailpit/mailpitcontainerresource/withdatavolume.md) -- `method` -- Configures a data volume for the MailPit container resource.
  ```go
  WithDataVolume(name string, options ...*WithDataVolumeOptions) MailPitContainerResource
  ```
