Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNau committed May 2, 2024
1 parent dea0aaa commit 22586b3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mailtrap.NET/Mailtrap.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>Mailtrap.NET</Title>
<Version>1.1.0-alpha</Version>
<Version>1.1.4-alpha</Version>
<Description>Mailtrap client for .NET</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
Expand Down
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# Mailtrap.NET
# Mailtrap.NET

.NET [Mailtrap](https://mailtrap.io) client (This client uses API v2)

## Installation

You can add this library to your project using [NuGet][nuget].

**Package Manager Console**
Run the following command in the “Package Manager Console”:

> PM> NuGet\Install-Package Mailtrap.NET -Version <version number>
**Visual Studio**
Right click to your project in Visual Studio, choose “Manage NuGet Packages” and search for ‘Mailtrap.NET’ and click ‘Install’.
([see NuGet Gallery][nuget-gallery].)

**.NET Core Command Line Interface**
Run the following command from your favorite shell or terminal:

> dotnet add package Mailtrap.NET --version <version number>
## Usage

You can initialize the client like the following:

```csharp
var client = new MailtrapClient(new HttpClient(), new MailtrapApiConfiguration(new Uri("<api url>"), "<api token>"));

```

#### Example: Send email with text

```csharp
var response = await client.EmailSending.SendAsync(new EmailWithText(
from: new EmailInfo("sender@email.com"),
to:
[
new EmailInfo ("recepient@email.com")
],
subject: "Custom Subject",
text: "Hello, I hope you received this email"));
```

0 comments on commit 22586b3

Please sign in to comment.