FlexiMail 0.1.0
dotnet add package FlexiMail --version 0.1.0
NuGet\Install-Package FlexiMail -Version 0.1.0
<PackageReference Include="FlexiMail" Version="0.1.0" />
paket add FlexiMail --version 0.1.0
#r "nuget: FlexiMail, 0.1.0"
// Install FlexiMail as a Cake Addin #addin nuget:?package=FlexiMail&version=0.1.0 // Install FlexiMail as a Cake Tool #tool nuget:?package=FlexiMail&version=0.1.0
FlexiMail
FlexiMail is a flexible email client library designed to integrate seamlessly into your .NET applications. It provides an easy-to-use interface for sending emails and managing various email-related tasks.
Features
- Easy Integration: Seamlessly integrate FlexiMail into your .NET projects.
- Multiple Email Providers: Support for multiple email service providers. [Call for contribution]
- Asynchronous Operations: Perform email sending and processing asynchronously.
- Testable Components: Easily write unit and integration tests for your email functionality.
Installation
You can install FlexiMail via NuGet or by adding the project to your solution manually.
NuGet Installation
To install FlexiMail using NuGet, run the following command in the NuGet Package Manager Console:
Install-Package FlexiMail
Or, you can find the package on NuGet.
.NET CLI Installation
To install FlexiMail using the .NET CLI, use the following command:
dotnet add package FlexiMail
Manual Installation
Clone the repository:
git clone https://github.com/mabroukmahdhi/FlexiMail
Add the
FlexiMail
project to your solution.Reference the
FlexiMail
project in your main application project.
Usage
To use FlexiMail, follow the steps below:
Basic Example
using FlexiMail;
public class EmailService
{
private readonly IFlexiMailClient flexiMailClient;
public EmailService(IFlexiMailClient flexiMailClient) =>
this.flexiMailClient = flexiMailClient;
public async Task SendWelcomeEmail(string recipientEmail)
{
var flexiMessage = new FlexiMessage()
{
Subject = "FlexiMail is a cool library",
To = [recipientEmail],
Body = new FlexiBody
{
Content = "<h3>Welcome to FlexiMail</h3><p>Bonjour tout le monde!</p>",
ContentType = BodyContentType.Html
}
};
await this.flexiMailClient.SendAndSaveCopyAsync(flexiMessage);
}
}
Configuration
FlexiMail can be configured to use different email service providers. Configure the desired provider in your app's configuration file:
{
"ExchangeConfigurations": {
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"TenantId": "your-tenant-id",
"SmtpAddress": "your-smtp-address",
"Sid": "your-sid",
"PrincipalName": "your-principal-name",
"Authority": "your-authority",
"Scopes": [
"scope1",
"scope2",
"scope3"
]
}
}
Note: You can use SmtpAddress
, Sid
or PrincipalName
in order to configure your exchange service.
Architecture
FlexiMail is organized into the following components according to The-Standard:
- Brokers: Handle communication with external email services.
- Models: Contain the data structures used across the library.
- Services: Core logic for sending and managing emails.
- Extensions: Helper methods and extensions for common tasks.
The main class, FlexiMailClient
, implements the IFlexiMailClient
interface and serves as the entry point for most
operations.
Testing
Unit tests are provided to ensure the reliability of the FlexiMail library. The tests are located in the
FlexiMail.Tests.Unit
and FlexiMail.Test.Integration
projects.
Running Tests
To run the tests, use the following command in the terminal:
dotnet test
Ensure that all dependencies are restored before running the tests.
Contributing
Contributions to FlexiMail are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b users/your-github-id/YourFeature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin users/your-github-id/YourFeature
). - Open a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For more information or questions, feel free to contact me at contact@mahdhi.com.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Microsoft.Exchange.WebServices (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Identity.Client (>= 4.63.0)
- Xeption (>= 2.8.0)
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 |
---|---|---|
0.1.0 | 119 | 8/11/2024 |
This release offers the beta version of FlexiMail.