Skip to content

Instantly share code, notes, and snippets.



Last active Mar 15, 2019
What would you like to do?
Sending SMS in WordPress (Required WP-SMS plugin)
<form method="post" action="">
Destination number:
<input type="text" value="" name="number" required>
<textarea name="message" required></textarea>
<input type="submit" name="sendsms">
if( isset($_POST['sendsms'])) {
if( is_object($sms) ) {
global $sms;
$sms->to = array($_POST['number']);
$sms->msg = $_POST['message'];
$result = $sms->SendSMS();
if($result) {
echo 'SMS was sent successfully.';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment