我如何在zend框架2中发送短信

Can any one know how to send it. I have tried some code but its. Imported file/class not found error show.

$service = new ZendService\DeveloperGarden\SendSms($config);
$sms = $service->createSms(
    '+49-172-123456; +49-177-789012',
    'your test message',
    'yourname'
);
print_r($service->send($sms));

Please help me which file need to import and how I tried like use ZendService\DeveloperGarden\SendSms; but its not working

any one better solution for ZF2..

First to use this service you need a Developer Garden account but unfortunately Developer Garden has closed it's services. see http://myaccount.developergarden.com/goodbye/ so you won't be able to use this module.

There are other companies that do PHP SMS. When I looked into for a client they found it wasn't cheap or free. A quick google search for PHP SMS will give you a long list.

To use it you would have roll your own ZF2 wrapper to integrate it with ZF2 and the company you choose as they will all have their separate API's.

Hope this helps

There are several SMS services that come with an PHP api. Three examples:

1) Twilio
You can find a code example here

2) TextMagic
A code example here

3) Plivo
Code examples on github

4) Spring Edge
Code examples on github

It will be easy to implement them in a PHP framework like Zend