Curiosus.SMS.Iqsms
3.0.0
dotnet add package Curiosus.SMS.Iqsms --version 3.0.0
NuGet\Install-Package Curiosus.SMS.Iqsms -Version 3.0.0
<PackageReference Include="Curiosus.SMS.Iqsms" Version="3.0.0" />
<PackageVersion Include="Curiosus.SMS.Iqsms" Version="3.0.0" />
<PackageReference Include="Curiosus.SMS.Iqsms" />
paket add Curiosus.SMS.Iqsms --version 3.0.0
#r "nuget: Curiosus.SMS.Iqsms, 3.0.0"
#:package Curiosus.SMS.Iqsms@3.0.0
#addin nuget:?package=Curiosus.SMS.Iqsms&version=3.0.0
#tool nuget:?package=Curiosus.SMS.Iqsms&version=3.0.0
Curiosus.SMS.Iqsms
ISmsSender implementation for IQSMS. Use it to send SMS via an iqsms.ru account,
directly or through Curiosus.Notifications.SMS.
Installation
dotnet add package Curiosus.SMS.Iqsms
Usage
IqsmsOptions requires Login and Password; Sender (sender name) is optional.
For example, bound from configuration:
IqsmsOptions:
Login: my-login
Password: my-password
Sender: MyCompany
AutoTransformPhoneNumber: true
var iqsmsOptions = configuration.GetSection("IqsmsOptions").Get<IqsmsOptions>()!;
// registers IIqsmsSender and, by default, ISmsSender
services.AddIqsmsSender(iqsmsOptions);
var result = await smsSender.SendSmsAsync("89123456789", "Hello iqsms!", cancellationToken);
if (!result.IsSuccess)
{
logger.LogError("Failed to send SMS: {Response}", result.Body.ResponseJson);
}
// per-message credentials or sender name
await smsSender.SendSmsAsync("+79123456789", "Hello!", new IqsmsExtraParams(null, null, "OtherSender"));
Pass useAsDefaultSender: false to register only IIqsmsSender (e.g. when another provider is the default ISmsSender).
Notes:
- iqsms.ru expects numbers as
+71234567890. WithAutoTransformPhoneNumber(defaulttrue) numbers starting with8or7are converted to this format. - Errors are mapped to
SmsError(Auth,Communication,NoMoney,DeliveryError,Unknown); the raw iqsms.ru response is available inSmsSentResult.ResponseJson. Cost and message count are not reported.
A runnable console sample is in samples/Curiosus.SMS.Iqsms.Sample.
HTTP requests go through the HttpClient named IqsmsSender.HttpClientName from IHttpClientFactory,
which AddIqsmsSender registers. Configure it for timeouts, a proxy or resilience handlers:
services.AddHttpClient(IqsmsSender.HttpClientName, client => client.Timeout = TimeSpan.FromSeconds(30));
See also
- Curiosus.SMS —
ISmsSenderabstraction - Curiosus.SMS.Smsc — sender for smsc.ru
- Curiosus.Notifications.SMS — SMS notification channel
- Curiosus.Utils — all packages
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- Curiosus.SMS (>= 2.0.0)
- Microsoft.Extensions.Http (>= 10.0.3)
-
net9.0
- Curiosus.SMS (>= 2.0.0)
- Microsoft.Extensions.Http (>= 9.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.