The PHP SDK uses a HTTP form post with cURL and OpenSSL to allow customers to access the Esendex services. This provides reliable communications over both secure and non-secure connections.
The SDK can be downloaded from our Downloads section.
The following applications are required to use the Esendex PHP SDK:
The PHP install will have the dll files in the extensions directory:
php_curl.dll
php_openSSL.dll
And the certificate file (for secure communications) is located in the Curl download:
Curl_ca_bundle.crt
These files will either need to be copied to a folder specified on the system path ( e.g. C:\Windows\ ), or the system path will have to be amended with the path to these files. We recommend that you add the php install directory to the system path as this makes it easier for you to update your PHP install when the new release is made available. For PHP to be configured to use OpenSSL and cURL on Windows we must uncomment the appropriate lines in the file ‘PHP.ini’ file being used to enable the Windows extensions.
;extension=php_curl.dll becomes extension=php_curl.dll
;extension=php_openssl.dll becomes extension=php_openssl.dll
Restarting your machine should implement these changes.
At this point it is useful to create a PHP file ‘phpinfo.php’ just containing the PHP code:
<?php
phpinfo();
?>
This will provide information on the system setup with respect to PHP. Setup your 'Test Web server' and open this PHP code file in your browser to confirm PHP is working on your system and the extension modules are recognised. Provided below is additional help in setting up your 'Test Web Server' on the two most popular servers used to test server side scripts locally.
To use the Esendex PHP SDK with IIS, carry out the following steps:
To use the Esendex PHP SDK with Apache, carry out the following steps:
LoadModule php5_module “PATH TO php5apache.dll”
AddType application/x-httpd-php .phpAdd a Virtual Host by including the lines: <VirtualHost *>
DocumentRoot PATH_TO_DIRECTORY_CONTAINING_PHP_FILES ServerName localhost
<VirtualHost>
The main change to the PHP SDK is that instead of using nusoap to communicate with webservices, HTTP form post is now used via cURL an OpenSSL. This provides reliable communications over both secure and non-secure services.
Functionality to enable a user to obtain the account message limits and other Account Services has been removed. A superior method for retrieving inbox messages has been added to the EsendexInboxservice.php class file.
The 5.1.1 PHP release required a change in the Esendex PHP SDK files so that the SDK worked with the latest most secure version of PHP. Although the updated SDK should work with older versions of PHP, we strongly recommend that you update to the versions specified in this document.
The Esendex scheduled send service has been added to allow customers to send messages at a specified date/time or by specifying a time period in days, hours and minutes.
The Esendex contact and subscription services have also been added to allow customers to manage their contacts/groups and subscriptions.