Skip to content
DocsTry Aspire
DocsTry

MailPitHostingExtension Methods

ClassMethods3 members
Provides extension methods for adding MailPit to an Hosting.IDistributedApplicationBuilder.
AddMailPit(IDistributedApplicationBuilder, string, int?, int?)Section titled AddMailPit(IDistributedApplicationBuilder, string, int?, int?)extensionIResourceBuilder<MailPitContainerResource>
Adds a MailPit container resource to the Hosting.IDistributedApplicationBuilder.
public static class MailPitHostingExtension
{
public static IResourceBuilder<MailPitContainerResource> AddMailPit(
this IDistributedApplicationBuilder builder,
string name,
int? httpPort = null,
int? smtpPort = null)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the MailPit resource will be added.
namestringThe name of the MailPit container resource.
httpPortint?optionalOptional. The HTTP port on which MailPit will listen.
smtpPortint?optionalOptional. The SMTP port on which MailPit will listen.
IResourceBuilder<MailPitContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
WithDataBindMount(IResourceBuilder<MailPitContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<MailPitContainerResource>, string, bool)extensionIResourceBuilder<MailPitContainerResource>
Configures a bind mount for the data directory of the MailPit container resource.
public static class MailPitHostingExtension
{
public static IResourceBuilder<MailPitContainerResource> WithDataBindMount(
this IResourceBuilder<MailPitContainerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<MailPitContainerResource>The ApplicationModel.IResourceBuilder`1 to configure the bind mount on.
sourcestringThe source path on the host system to bind to the container.
isReadOnlybooloptionalA value indicating whether the bind mount should be read-only. Default is false.
IResourceBuilder<MailPitContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 with the configured bind mount.
WithDataVolume(IResourceBuilder<MailPitContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<MailPitContainerResource>, string, bool)extensionIResourceBuilder<MailPitContainerResource>
Configures a data volume for the MailPit container resource.
public static class MailPitHostingExtension
{
public static IResourceBuilder<MailPitContainerResource> WithDataVolume(
this IResourceBuilder<MailPitContainerResource> builder,
string name,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<MailPitContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
namestringThe name of the data volume to be mounted.
isReadOnlybooloptionalA boolean indicating whether the volume should be mounted as read-only.
IResourceBuilder<MailPitContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.