Code: Select all
public static async Task SendHelloWorld()
{
LogManager.SetLoggerFactory(new ConsoleLogFactory(LogLevel.Verbose));
using (SmppClient client = new SmppClient())
{
try
{
if (await client.ConnectAsync(new DnsEndPoint("xxx", 4200, AddressFamily.InterNetwork)))
{
BindResp bindResp = await client.BindAsync("xxx", "xxx");
if (bindResp.Header.Status == CommandStatus.ESME_ROK)
{
var submitResp = await client.SubmitAsync(
SMS.ForSubmit()
.From("xxx")
.To("xxx")
.Coding(DataCodings.Latin1)
.Text("Bestätige deine Nummer mit folgendem Link um zu deiner persönlichen"));
if (submitResp.All(x => x.Header.Status == CommandStatus.ESME_ROK))
{
client.Logger.Info("Message has been sent.");
}
}
await client.DisconnectAsync();
}
}
catch (Exception ex)
{
client.Logger.Error("Failed send message", ex);
}
}
}
Code: Select all
Encoding iso = Encoding.GetEncoding("ISO-8859-1");
byte[] isoBytes = iso.GetBytes("Bestätige deine Nummer mit folgendem Link um zu deiner persönlichen");
Any help with this is really appreciated.