FahdCloud.ThirdParty.SMS 10.0.6

dotnet add package FahdCloud.ThirdParty.SMS --version 10.0.6
                    
NuGet\Install-Package FahdCloud.ThirdParty.SMS -Version 10.0.6
                    
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="FahdCloud.ThirdParty.SMS" Version="10.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FahdCloud.ThirdParty.SMS" Version="10.0.6" />
                    
Directory.Packages.props
<PackageReference Include="FahdCloud.ThirdParty.SMS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FahdCloud.ThirdParty.SMS --version 10.0.6
                    
#r "nuget: FahdCloud.ThirdParty.SMS, 10.0.6"
                    
#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.
#:package FahdCloud.ThirdParty.SMS@10.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FahdCloud.ThirdParty.SMS&version=10.0.6
                    
Install as a Cake Addin
#tool nuget:?package=FahdCloud.ThirdParty.SMS&version=10.0.6
                    
Install as a Cake Tool

FahdCloud.ThirdParty.SMS

FahdCloud.ThirdParty.SMS provides stateless SMS services for:

  • SMS Masr
  • Taqnyat SMS

Each call receives provider settings explicitly. Provider base URLs are fixed inside the library.

Installation

dotnet add package FahdCloud.ThirdParty.SMS

Registration

using FahdCloud.ThirdParty.SMS.DependencyInjection;

builder.Services.AddSmsProviders();

Or register a single provider:

builder.Services.AddSmsMasr();
builder.Services.AddTaqnyatSms();

SMS Masr Example

using FahdCloud.ThirdParty.SMS.Abstractions;
using FahdCloud.ThirdParty.SMS.Models;
using FahdCloud.ThirdParty.SMS.Providers.SmsMasr;

public sealed class SmsMasrSender(ISmsMasrService smsMasrService)
{
    public Task<SmsSendResponse> SendAsync(CancellationToken cancellationToken)
    {
        var settings = new SmsMasrSettings
        {
            Username = "your-user",
            Password = "your-password",
            SenderToken = "your-sender-token",
            Environment = 2
        };

        var request = new SmsSendRequest
        {
            To = ["201001234567"],
            Message = "Hello from FahdCloud SMS",
            Language = SmsMessageLanguage.English
        };

        return smsMasrService.SendMessageAsync(settings, request, cancellationToken);
    }
}

SMS Masr OTP Example

using FahdCloud.ThirdParty.SMS.Providers.SmsMasr;

public sealed class OtpSender(ISmsMasrService smsMasrService)
{
    public Task SendAsync(CancellationToken cancellationToken)
    {
        var settings = new SmsMasrSettings
        {
            Username = "your-user",
            Password = "your-password",
            SenderToken = "your-sender-token",
            Environment = 2
        };

        return smsMasrService.SendOtpAsync(settings, new SmsMasrOtpRequest
        {
            Mobile = "+201001234567",
            TemplateToken = "template-token",
            Otp = "123456"
        }, cancellationToken);
    }
}

Taqnyat Example

using FahdCloud.ThirdParty.SMS.Models;
using FahdCloud.ThirdParty.SMS.Providers.Taqnyat;

public sealed class TaqnyatSender(ITaqnyatSmsService taqnyatSmsService)
{
    public Task<SmsSendResponse> SendAsync(CancellationToken cancellationToken)
    {
        var settings = new TaqnyatSmsSettings
        {
            BearerToken = "your-bearer-token",
            DefaultSender = "YourSender"
        };

        var request = new SmsSendRequest
        {
            To = ["966500000000"],
            Message = "Hello from FahdCloud SMS"
        };

        return taqnyatSmsService.SendMessageAsync(settings, request, cancellationToken);
    }
}

Taqnyat Scheduled Message Example

using FahdCloud.ThirdParty.SMS.Providers.Taqnyat;

public sealed class ScheduledSmsSender(ITaqnyatSmsService taqnyatSmsService)
{
    public Task SendAsync(CancellationToken cancellationToken)
    {
        var settings = new TaqnyatSmsSettings
        {
            BearerToken = "your-bearer-token",
            DefaultSender = "YourSender"
        };

        return taqnyatSmsService.SendScheduledMessageAsync(settings, new TaqnyatScheduledMessageRequest
        {
            Recipients = ["966500000000"],
            Body = "Scheduled hello",
            ScheduledAt = DateTimeOffset.UtcNow.AddHours(1)
        }, cancellationToken);
    }
}

Provider Operations

SMS Masr

  • SendMessageAsync(settings, request)
  • SendOtpAsync(settings, request)
  • GetBalanceAsync(settings)

Taqnyat

  • SendMessageAsync(settings, request)
  • SendScheduledMessageAsync(settings, request)
  • DeleteScheduledMessageAsync(settings, deleteId)
  • GetBalanceAsync(settings)
  • GetSendersAsync(settings)

Notes

  • Services are stateless.
  • Provider base URLs are internal constants in the library.
  • Phone numbers are normalized to international format without + or leading 00.
  • SMS Masr sends multiple recipients as a comma-separated mobile value.
  • Taqnyat sends recipients as a JSON array and authenticates with bearer token.
  • Refit is used internally for provider API contracts.

Test Project

The test project is a console-based integration harness.

Files:

To use it:

  1. Fill in provider credentials and test recipients in tests/FahdCloud.ThirdParty.SMS.Tests/appsettings.json.
  2. Run the test project.
  3. Choose the provider from the console menu.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
10.0.6 465 4/21/2026
10.0.5 116 4/21/2026
10.0.4 113 4/21/2026
10.0.3 110 4/21/2026
10.0.2 130 4/19/2026
10.0.1 148 4/14/2026
10.0.0 117 4/14/2026