MYDev.YoueSms
1.0.0-preview.3
.NET 10.0
This package targets .NET 10.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
This is a prerelease version of MYDev.YoueSms.
dotnet add package MYDev.YoueSms --version 1.0.0-preview.3
NuGet\Install-Package MYDev.YoueSms -Version 1.0.0-preview.3
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="MYDev.YoueSms" Version="1.0.0-preview.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MYDev.YoueSms" Version="1.0.0-preview.3" />
<PackageReference Include="MYDev.YoueSms" />
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 MYDev.YoueSms --version 1.0.0-preview.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MYDev.YoueSms, 1.0.0-preview.3"
#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 MYDev.YoueSms@1.0.0-preview.3
#: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=MYDev.YoueSms&version=1.0.0-preview.3&prerelease
#tool nuget:?package=MYDev.YoueSms&version=1.0.0-preview.3&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MYDev.YoueSms 优易短信 SDK
.NET SDK for 优易短信 (Youe SMS) 服务,提供企业级短信发送解决方案。
功能特性
- 完整的优易短信 API 接口封装
- 基于 .NET Standard 2.0 构建,支持跨平台
- 支持短信发送、余额查询等核心功能
- 集成依赖注入扩展
- 异常处理与错误信息封装
配置
在 appsettings.json 中添加配置:
{
"YoueSms": {
"UserName": "your-username",
"Password": "your-password",
"Subject": "【公司名称】"
}
}
在 Startup.cs 或 Program.cs 中注册服务:
// 注册服务
services.AddYoueSms();
// 配置选项
services.Configure<YoueSmsOptions>(configuration.GetSection("YoueSms"));
核心概念
- 短信发送:支持普通短信发送,自动添加签名
- 余额查询:查询账户短信余额
API 请求列表
| 请求类 | 接口说明 | 端点 |
|---|---|---|
| YoueRequests.SendRequest | 发送短信 | /smsmarketing/wwwroot/interface/postSendSms/ |
| YoueRequests.BalanceQueryRequest | 查询余额 | /smsmarketing/wwwroot/api//user_info/?uid={0}&pwd={1} |
使用示例
发送短信
var request = YoueRequests.ToSend(new YoueRequests.SendModel
{
Mobile = "13800138000",
Message = "您的验证码是:123456",
DTime = DateTime.Now.AddMinutes(5) // 可选,定时发送时间
});
var response = await sender.SendAsync(request, youeSmsOptions);
查询余额
var request = YoueRequests.ToBalanceQuery();
var response = await sender.SendAsync(request, youeSmsOptions);
异常处理
所有 API 错误都会通过 HTTP 状态码和响应内容体现,开发者可根据具体情况进行处理。
| Product | Versions 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. net9.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.
-
.NETStandard 2.0
- Sparkdo.Core (>= 1.0.1)
- Sparkdo.Sdks.Abstractions (>= 1.0.1)
- Sparkdo.Sms (>= 1.0.1)
-
net10.0
- Sparkdo.Core (>= 1.0.1)
- Sparkdo.Sdks.Abstractions (>= 1.0.1)
- Sparkdo.Sms (>= 1.0.1)
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.0.0-preview.3 | 147 | 12/4/2025 |
| 1.0.0-preview.2 | 620 | 12/2/2025 |
| 1.0.0-preview.1 | 133 | 11/27/2025 |