Text messaging has become incredibly inescapable all through the world. It reduces costs, provides efficient service delivery, enhances marketing promotions, and improves staff communications. It can connect faster with short messages containing crucial bits of information, rather than long conversations. Since mobile phones are almost always within our arm's reach, SMS is landing straight into the customer's hands. SMS is very personal because it's delivered directly to your customer's mobile phone.
This application allows us to compose a message. In order to send an SMS from a website to a mobile, we need a third party API. The SMS gateway allows a computer system to send or receive SMS to or from a telecommunications network. There are lots of free or commercial SMS gateways available.
To fulfill this requirement, we used to have an HTML form that allows the user to enter the required SMS details, i.e., phone number and message text. On submitting the form, the data is posted to a PHP script, where we have sent the SMS text through a gateway.
index.php
Suppose we have the following interface to get the phone number of the recipient and the message text from the website visitors. When the user clicks on the 'Send Message' button, the data will be posted to 'phpsendsms.php' page-
This file is responsible for sending SMS. It collects the form data and configures the authentication key and sender id. The API gateway URL is used to pass the SMS to the gateway. So, there are three entities you basically need from your configuration gateway - Authentication Key, Sender ID and Gateway URL. The curl_setopt_array() method is used here to transfer multiple options to a CURL.
Make sure to replace the YOUR_AUTH_KEY, YOUR_SENDER_ID and YOUR_GATEWAY_URL.
The above code returns TRUE with message id if all options were successfully set. If an option could not be successfully set, FALSE is immediately returned.
Text messaging has become incredibly inescapable all through the world. It reduces costs, provides efficient service delivery, enhances marketing promotions, and improves staff communications. It can connect faster with short messages containing crucial bits of information, rather than long conversations. Since mobile phones are almost always within our arm's reach, SMS is landing straight into the customer's hands. SMS is very personal because it's delivered directly to your customer's mobile phone.
This application allows us to compose a message. In order to send an SMS from a website to a mobile, we need a third party API. The SMS gateway allows a computer system to send or receive SMS to or from a telecommunications network. There are lots of free or commercial SMS gateways available.
To fulfill this requirement, we used to have an HTML form that allows the user to enter the required SMS details, i.e., phone number and message text. On submitting the form, the data is posted to a PHP script, where we have sent the SMS text through a gateway.
index.php
Suppose we have the following interface to get the phone number of the recipient and the message text from the website visitors. When the user clicks on the 'Send Message' button, the data will be posted to 'phpsendsms.php' page-
phpsendsms.php
This file is responsible for sending SMS. It collects the form data and configures the authentication key and sender id. The API gateway URL is used to pass the SMS to the gateway. So, there are three entities you basically need from your configuration gateway - Authentication Key, Sender ID and Gateway URL. The curl_setopt_array() method is used here to transfer multiple options to a CURL.
Make sure to replace the YOUR_AUTH_KEY, YOUR_SENDER_ID and YOUR_GATEWAY_URL.
The above code returns TRUE with message id if all options were successfully set. If an option could not be successfully set, FALSE is immediately returned.
need an explanation for this answer? contact us directly to get an explanation for this answer