Biotekno.Mobiliva.XmlSmsSender 1.6.17

dotnet add package Biotekno.Mobiliva.XmlSmsSender --version 1.6.17
                    
NuGet\Install-Package Biotekno.Mobiliva.XmlSmsSender -Version 1.6.17
                    
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="Biotekno.Mobiliva.XmlSmsSender" Version="1.6.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Biotekno.Mobiliva.XmlSmsSender" Version="1.6.17" />
                    
Directory.Packages.props
<PackageReference Include="Biotekno.Mobiliva.XmlSmsSender" />
                    
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 Biotekno.Mobiliva.XmlSmsSender --version 1.6.17
                    
#r "nuget: Biotekno.Mobiliva.XmlSmsSender, 1.6.17"
                    
#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 Biotekno.Mobiliva.XmlSmsSender@1.6.17
                    
#: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=Biotekno.Mobiliva.XmlSmsSender&version=1.6.17
                    
Install as a Cake Addin
#tool nuget:?package=Biotekno.Mobiliva.XmlSmsSender&version=1.6.17
                    
Install as a Cake Tool

XmlSmsSender

SmsToMany: Aynı mesajı birden farklı kişiye göndermemize yarar. SmsToOne: Bir kişiye bir mesaj göndermemize yarar.

Ayarların verilmesi

Paket iki farklı ayar okuma yaklaşımını destekler:

  1. Önerilen kullanım: SmsSenderOptions nesnesini uygulama tarafında oluşturup ilgili sınıfa constructor üzerinden vermek.
  2. Eski kullanım: Uygulamanın çalışma dizinindeki settings.txt dosyasından KEY=VALUE formatında ayar okumak.

Yeni projelerde SmsSenderOptions kullanılması önerilir. settings.txt desteği geriye dönük uyumluluk için devam eder.

SmsSenderOptions ile kullanım

var options = new SmsSenderOptions
{
    XML_SENT_SERVLET = "https://smsapi.jetsms.com.tr/SMS-Web8/xmlsms",
    XML_REPORT_SERVLET = "https://smsapi.jetsms.com.tr/SMS-Web8/xmlreport",
    XML_DATE_REPORT_SERVLET = "https://smsapi.jetsms.com.tr/SMS-Web8/xmldatereport",
    REPORT_TIME_OUT = 30
};

var smsToOne = new SmsToOne(options);
var smsToMany = new SmsToMany(options);

ASP.NET Core projelerinde bu değerler appsettings.json içinde tutulabilir:

{
  "SmsSenderOptions": {
    "XML_SENT_SERVLET": "https://smsapi.jetsms.com.tr/SMS-Web8/xmlsms",
    "XML_REPORT_SERVLET": "https://smsapi.jetsms.com.tr/SMS-Web8/xmlreport",
    "XML_DATE_REPORT_SERVLET": "https://smsapi.jetsms.com.tr/SMS-Web8/xmldatereport",
    "REPORT_TIME_OUT": 30
  }
}

Uygulama tarafında bind etmek için:

services.Configure<SmsSenderOptions>(
    Configuration.GetSection("SmsSenderOptions"));

Kullanım örneği:

public class SmsService
{
    private readonly SmsSenderOptions _options;

    public SmsService(IOptions<SmsSenderOptions> options)
    {
        _options = options.Value;
    }

    public ResponseFromHostV2 Send()
    {
        var sms = new SmsToOne(_options)
        {
            Username = "username",
            Password = "password",
            Channel = "channel",
            Originator = "Headers",
            ProcessType = "xml"
        };

        sms.setMessage("5555555555", "message text");
        return sms.sendMessageV2();
    }
}

settings.txt ile kullanım

Bazı eski akışlar ve proxy ayarları settings.txt dosyasından okunur. Dosya paketin içinde değil, paketi kullanan uygulamanın çalışma dizininde bulunmalıdır. ASP.NET/IIS veya servis ortamlarında bu dizin uygulamanın yayın çıktısı ya da process working directory'si olabilir.

Örnek settings.txt:

XML_SENT_SERVLET=https://smsapi.jetsms.com.tr/SMS-Web8/xmlsms
USE_PROXY=0
PROXY_ADRES=
PROXY_PORT=
PROXY_USER_NAME=
PROXY_PASSWORD=
DOMAIN=
SslProtocol=Tls12

settings.txt içinde desteklenen başlıca değerler:

Anahtar Açıklama
XML_SENT_SERVLET Eski gönderim akışında SMS gönderim adresi.
USE_PROXY Proxy kullanımı. 1 ise proxy aktif kabul edilir.
PROXY_ADRES Proxy host/adres değeri.
PROXY_PORT Proxy port değeri.
PROXY_USER_NAME Proxy kullanıcı adı.
PROXY_PASSWORD Proxy şifresi.
DOMAIN Proxy kimlik doğrulama domain değeri.
SslProtocol Kullanılacak SSL/TLS protokolü. Örn. Tls12.

Notlar:

  • settings.txt dosyası bulunamazsa, dosyayı kullanan eski akışlarda hata alınabilir.
  • Dosya formatı satır başına KEY=VALUE şeklinde olmalıdır.
  • SslProtocol için önce uygulama konfigürasyonu kontrol edilir; değer bulunamazsa settings.txt fallback olarak denenir.

Örnek kullanım aşağıdaki gibidir.

public async Task<string> SmsToMany()
{
    var smsToMany = new SmsToMany
    {
        Version = "",
        ProcessType = "xml",
        Username = "username",
        Password = "password",
        ExclusionTimeStart = "",
        ExclusionTimeStop = "",
        Channel = "channel",
        Text = "message text",
        MessageType = "message type",
        ChannelType = "channel type",
        IsTCKN = false,
        IsVKN = false,
        IYSCode = "iys code",
        Reference = "referance value",
        TotalMessageCount = 1,
        IsBlacklistFilterActive = false,
        StartDate = DateTime.Now.ToString("ddMMyyyyHHmm00"),
        ExpireDate = DateTime.Now.AddDays(1).ToString("ddMMyyyyHHmm00"),
        Originator = "Headers"
    };
    var numberList = new List<string>
    {
        "5555555555"
        //NumberList
    };
    smsToMany.setGsmNumbers(numberList.ToArray());
    var xmlRequest = smsToMany.createXmlData();
    //Xml sms send address
    var resultString = await PostXml.PostXmlData(
        xmlRequest, "::1");
    var result = new ResponseFromHost();
    var parsedResult = resultString.Split(" ");

    //Result code 00 ise gönderim başarılıdır ve result.Message değeri processId olur
    result.Code = parsedResult[0].Replace("\n", string.Empty);
    return result.Code.Equals("00") ? result.Message : $"Error Code:{result.Code}";
}

SmsToMany class’ının içini xmle’e çevirmek istediğimiz alanlar ile dolduruyoruz. Daha sonra o class’a verdiğimiz referanstan içindeki setGsmNumbers methonuda bir gsm Numara arrayi veriyoruz ve ondan sonra gene ilgili referanstan createXmlData methodunu çağırarak xme formata çeviriyoruz ve PostXml static class’ının içindeki PostXmlData methoduna ilgili sunucu adresimizi ve göndereceğimiz xml format vererek işlemi gerçekleştiriyoruz. Eğer sunucu adresi vermezsek default "https://api.jetsms.com.tr/SMS-Web8/xmlsms" budur. PostXmlData dan geriye dönen result eğer code 00 ise gönderim başarılıdır ve mesajı ProcessId olur.

 public async Task<string> SmsToOne()
{
    var smsToOne = new SmsToOne( new SmsSenderOptions()
    {
        XML_SENT_SERVLET = "https://smsapi.jetsms.com.tr/SMS-Web8/xmlsms"
    })
    {
        Version = "",
        ProcessType = "xml",
        Username = "UserName",
        Password = "Password.",
        ExclusionTimeStart = "",
        ExclusionTimeStop = "",
        Channel = "Channel",
        MessageType = "message type",
        ChannelType = "channel type",
        IsTCKN = false,
        IsVKN = false,
        IYSCode = "iys code",
        Reference = "referance value",
        TotalMessageCount = 1,
        IsBlacklistFilterActive = false,
        StartDate = DateTime.Now.ToString("ddMMyyyyHHmm00"),
        ExpireDate = DateTime.Now.AddDays(1).ToString("ddMMyyyyHHmm00"),
        Originator = "Headers"
    };
    smsToOne.setMessage("Number", "Message");

    var xmlRequest = smsToOne.sendMessageV2();
    //Xml sms send address

    var result = new ResponseFromHost();


    //Result code 00 ise gönderim başarılıdır ve result.Message değeri processId olur
    result.Code = xmlRequest.ResponseCode;
    result.Message = xmlRequest.ResponseMessage;
    return result.Code.Equals("00") ? result.Message : $"Error Code:{result.Code}";
}

SSL/TLS protokol ayarını farklı konfigürasyonlardan (ör. app.config, settings.txt ve .NET Core için appsettings.json) nasıl kullanacağınız gösteren örnekler:

Aşağıdaki değerleri alabilir.

  • Tls
  • Tls11
  • Tls12
  • Tls13

App.config Dosyası:

<configuration>
  <appSettings>
    <add key="SslProtocol" value="Tls12" />
  </appSettings>
</configuration>

settings.txt Dosyası

SslProtocol=Tls11

appsettings.json Dosyası:

{
  "SslProtocol": "Tls12"
}
Product 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 was computed.  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 net451 is compatible.  net452 was computed.  net46 was computed.  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.

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.6.17 133 8/20/2026
1.6.16 142 7/24/2026
1.6.14 168 7/2/2026 1.6.14 is deprecated because it is no longer maintained and has critical bugs.
1.6.13 211 5/13/2026
1.6.12.1 192 3/26/2026
1.6.12 127 3/26/2026
1.6.10 2,775 9/18/2024
1.6.9 267 9/6/2024
1.6.8 229 9/6/2024
1.6.7 1,214 8/21/2024
1.6.6 245 8/19/2024
1.6.5 3,438 5/31/2024
1.6.4 1,038 12/7/2023
1.6.3 235 12/7/2023
1.6.2 204 12/5/2023
1.6.1 211 12/1/2023
1.6.0-pre 670 9/19/2023
1.5.1 7,261 1/2/2023 1.5.1 is deprecated because it is no longer maintained and has critical bugs.
1.5.1-pre 168 9/19/2023
Loading failed