Page 1 of 1

tip on doing line breaks for outbound SMS messages

Posted: Mon Jan 13, 2014 4:18 pm
by support
Hi,

If you're looking to set up line breaks for your outbound SMS API, you can use the following PHP code sample as reference:

queuesms.php:

Code: Select all

<?php
header("Content-type: text/xml");

$params['to'] = "19998881234";
$params['from'] = "2435678910";
$params['body'] = "This is a notification.\n\nPlease check your e-mail when you come back.";

// initialize curl
$ch = curl_init();

// set necessary curl options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, "http://hosting.plumgroup.com/ws/sms/queue.xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");

echo(curl_exec($ch));

curl_close($ch);
?>
This would display the text message as:
This is a notification.

Please check your e-mail when you come back.
Regards,
Plum Support