Wednesday, November 23, 2016

Send SMS from your Salesforce org

Below is the code to send SMS on our mobile from our Salesforce ORG.

Prerequisite: - You must have a valid account on fullonsms.com

String Message = 'Hi,this is test message';            (// Write here your Test Message)
String uid = '9999326589';              (//Write here your fullonsms.com user Name)
String password = 'pass1';            (//Write here your fullonsms.com Password)
String no = '9636985623';               (//Write here mobile number where you need to send SMS))

String Url='http://ubaid.tk/sms/sms.aspx?uid=' + uid + '&pwd=' + password + '&msg=' + message + '&phone=' + no + '&provider=fullonsms';
  Http h = new Http();
       
        // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
req.setEndpoint(Url);
req.setMethod('GET');
req.setTimeout(12000);      
        // Send the request, and return a response
HttpResponse res = h.send(req);

System.debug('@@@@'+res.getBody());

For More details, go to below link:-


No comments:

Post a Comment