Inbucket.CSharp.Client 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Inbucket.CSharp.Client --version 1.1.0                
NuGet\Install-Package Inbucket.CSharp.Client -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Inbucket.CSharp.Client" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Inbucket.CSharp.Client --version 1.1.0                
#r "nuget: Inbucket.CSharp.Client, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Inbucket.CSharp.Client as a Cake Addin
#addin nuget:?package=Inbucket.CSharp.Client&version=1.1.0

// Install Inbucket.CSharp.Client as a Cake Tool
#tool nuget:?package=Inbucket.CSharp.Client&version=1.1.0                

Inbucket CSharp Client

Build Status

CSharp (.NET Core) client for the Inbucket API.

Inbucket

Inbucket is an email testing service, it will accept messages for any email address and make them available via web, REST and POP3. Read more at the Inbucket Website.

About the library

REST API

The current library support all the base methods offered by Inbucket:

  • List Mailbox Contents.
  • Get Message by Id.
  • Get Message source.
  • Delete Message.
  • Purge Mailbox.

How to use

To start using the Inbucket Client you need to create a new instance. To do that, you have two choices:

// Create a new Instance by specifying the base Uri, the port and the MailBox.
var inbucketClient = new InbucketClient("localhost", 9000, "<mailbox-name>");

// Or, passe the URI object and the MailBox.
var inbucketClient = new InbucketClient(new Uri("http://localhost:900", "<mailbox-name>"));

The library offers the following methods:

/// <summary>
/// Get the Mailbox from the email.
/// </summary>
var mailbox = inbucketClient.GetMailBoxFromEmail("<email-address>");

/// <summary>
/// Get or Set the object {CurrentMailBox} property and returns it.
/// If you specify the MailBox, the method will set the object {CurrentMailBox} property and return the values.
/// If nothing specifid, the method will simply return the current MailBox value.
/// </summary>
var mailbox = inbucketClient.MailBox("<email-address>");

/// <summary>
/// Gets the specified message details.
/// Calls the Inbucket endpoint [GET] {/api/v1/mailbox/{mailbox}/{id}}.
/// Note: if the {mailbox} parameter is not specified the method will take the object default mailbox.
/// If Specified, it will set the object default mailbox before calling the Inbucket API.
/// </summary>
var message = await inbucketClient.GetMessageAsync("<message-id>", (optional)"<mailbox-name>");

/// <summary>
/// Gets the specified message source information.
/// Calls the Inbucket endpoint [GET] {/api/v1/mailbox/{mailbox}/{id}/source}.
/// Note: if the {mailbox} parameter is not specified the method will take the object default mailbox.
/// If Specified, it will set the object default mailbox before calling the Inbucket API.
/// </summary>
var messageSource = await inbucketClient.GetMessageSourceAsync("<message-id>", (optional)"<mailbox-name>");

/// <summary>
/// Gets All the messages basic details from the specified MailBox.
/// Calls the Inbucket endpoint [GET] {/api/v1/mailbox/{mailbox}.
/// Note: if the {mailbox} parameter is not specified the method will take the object default mailbox.
/// If Specified, it will set the object default mailbox before calling the Inbucket API.
/// </summary>
var mailboxContent = await inbucketClient.GetMailBoxMessagesAsync((optional)"<mailbox-name>");

/// <summary>
/// Delete the message from the mailbox.
/// Calls the Inbucket endpoint [DELETE] {/api/v1/mailbox/{mailbox}/{id}}.
/// Note: if the {mailbox} parameter is not specified the method will take the object default mailbox.
/// If Specified, it will set the object default mailbox before calling the Inbucket API.
/// </summary>
var isDeleted = await inbucketClient.DeleteMessageAsync(string id, string mailbox = default);

/// <summary>
/// Delete all the messages from the mailbox.
/// Calls the Inbucket endpoint [DELETE] {/api/v1/mailbox/{mailbox}}.
/// Note: if the {mailbox} parameter is not specified the method will take the object default mailbox.
/// If Specified, it will set the object default mailbox before calling the Inbucket API.
/// </summary>
var isPurged = await inbucketClient.PurgeMailBoxAsync(string mailbox = default);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 5,555 11/7/2020
1.1.0 10,553 8/26/2020
1.0.0 11,978 10/29/2019
1.0.0-beta 4,732 10/29/2019
1.0.0-alpha 4,877 10/29/2019

v1.1.0