How to SMS from AX 2012 through Code (X++)

System.Net.WebClient cust;
System.IO.Stream data;
System.IO.StreamReader reader;
System.String URLAddres;
Str SMSConfirmID;
;

cust = new System.Net.WebClient();
// Create a String with User, password, api_id, to, Text as required
// example to form string given below ( to be register with clickatell for credits)

URLAddres = “http://www.smszone.in/sendsms.asp?page=SendSmsBulk&username=966535865845&password=6668&number=” + _mobileNo +”&message=” + _message;
data = cust.OpenRead(URLAddres);
reader = new System.IO.StreamReader(data);
SMSConfirmID = reader.ReadToEnd();
data.Close();
reader.Close();
info(SMSConfirmID);

return true;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s