Sunday, January 17, 2021

Send sms txt via code in D365 F&O

 In this post, We will be writing code to send SMS via code :


System.Net.WebClient custWebclient;

System.IO.Stream InfoData;

System.IO.StreamReader Streamreader;

System.String URLStr;

Str SMSConfirmID;

str mobileno='919871286647';

str message='Test message';


custWebclient=new System.Net.WebClient();


URLStr = "https://api.textlocal.in/send/?apikey=" + "YOURAPIKEY" + "&numbers=" + mobileno + "&message=" + message + "&sender=txtcl";


InfoData=custWebclient.OpenRead(URLStr);

Streamreader=new System.IO.StreamReader(InfoData);

SMSConfirmID=Streamreader.ReadToEnd();

InfoData.Close();

Streamreader.Close();