Alphabetical sender id is not sending SMS by Twilio
0 down vote favorite I've setup the Twilio in salesforce to send the SMS. Twilio is configured perfectly.
The number on which I'm try to send the SMS is also in the supportable country list of alphanumeric sender id list. Country : Lebanon.
when i Put the From number is : like +1 45********. then I'm able to send the SMs. But when i put the From number is "CompanyName", then its not sending SMS.
Error.
The From phone number "CompanyName" is not a valid, SMS-capable inbound phone number or short code for your account.
Please Note: Alphanumeric Sender Id is enabled for my account. Also my account is upgraded.
my code is Below;
global Static String sendOTP(string PhoneNo){
Integer rand = Math.round(Math.random()*100000);
string VerificationCode = string.valueOf(rand);
String smsBody='Your Verification code is : '+VerificationCode +'. Please don\'t reply.';
final String fromNumber = '+14*******';
//final String fromNumber = 'Comapany'; //Not working
String account = '********'; // Account SID on home tab
String token = '*****'; //AUTH Token on home tab
TwilioRestClient client = new TwilioRestClient(account, token);
if(PhoneNo != null)
{
Map<String,String> params = new Map<String,String> {
'To' => PhoneNo,
'From' => fromNumber,
'Body' => smsBody
};
try{
TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
system.debug('******');
return VerificationCode;
}
catch(Exception e )
{
system.debug('@@@@'+e);
return 'false';
}
}
return 'false';
}
Please suggest what is the wrong here.