Yes this is question. How to do double sided as you need provider (gatway).
Printable View
Yes this is question. How to do double sided as you need provider (gatway).
There is a wordpress plugin that allows users to send SMS messages... it is open source, so a bit of a peek into the code might help anyone who is interested in developing this further...
my countrie is Rwanda
my countrie is Rwanda
I don’t know if it this works without an sms gateway provider. If it works for others, kindly let me know as well.
I have the exact same problem as Stephen. I want sales@mysite.com to be the "from" email but it is being replaced by the .shr.phx8.secureserver.net address. I too am using godaddy hosting. Many thanks to anyone who can help me with this.
You can send text message to usa, canada and international destinations using txtimpact php library.
TxtImpact SMS gateway
Keep Texting!!
You could always use a contact form which calls the SourceSMS API.
PHP Code:<?php
// Data for text message. This is the text message data.
$from = "FROM"; // This is who the message appears to be from.
$to = "777000000"; //A single number or a comma-seperated list of numbers
// $message = "This is a test message from the PHP API script"; //160 chars or less
$username = "Your SourceSMS Username"; // insert your username
$pword = "Your SourceSMS API Password"; //Your developer API password
$hash = "RjK=H4kL"; //Do not change
$formCountry = "44"; //Change this to the appropiate country code (default UK)
$sourceinfo = "1"; //Display POST info
//extract data from the post
//extract($_POST);
//set POST variables
$url = 'http://sourcesms.com/api/api-function.php';
$fields = array(
'from'=>urlencode($from),
'to'=>urlencode($to),
'message'=>urlencode($message),
'username'=>urlencode($username),
'pword'=>urlencode($pword),
'hash'=>urlencode($hash),
'formCountry'=>urlencode($formCountry),
'sourceinfo'=>urlencode($sourceinfo)
);
//url-*** the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
?>
There is also one another PHP script like:
Source: http://www.ozekisms.com/index.php?owpn=327PHP Code:<?php
########################################################
# Login information for the SMS Gateway
########################################################
$ozeki_user = "admin";
$ozeki_password = "abc123";
$ozeki_url = "http://127.0.0.1:9501/api?";
########################################################
# Functions used to send the SMS message
########################################################
function httpRequest($url){
$pattern = "/http...([0-9a-zA-Z-.]*).([0-9]*).(.*)/";
preg_match($pattern,$url,$args);
$in = "";
$fp = fsockopen("$args[1]", $args[2], $errno, $errstr, 30);
if (!$fp) {
return("$errstr ($errno)");
} else {
$out = "GET /$args[3] HTTP/1.1\r\n";
$out .= "Host: $args[1]:$args[2]\r\n";
$out .= "User-agent: Ozeki PHP client\r\n";
$out .= "Accept: */*\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$in.=fgets($fp, 128);
}
}
fclose($fp);
return($in);
}
function ozekiSend($phone, $msg, $debug=false){
global $ozeki_user,$ozeki_password,$ozeki_url;
$url = 'username='.$ozeki_user;
$url.= '&password='.$ozeki_password;
$url.= '&action=sendmessage';
$url.= '&messagetype=SMS:TEXT';
$url.= '&recipient='.urlencode($phone);
$url.= '&messagedata='.urlencode($msg);
$urltouse = $ozeki_url.$url;
if ($debug) { echo "Request: <br>$urltouse<br><br>"; }
//Open the URL to send the message
$response = httpRequest($urltouse);
if ($debug) {
echo "Response: <br><pre>".
str_replace(array("<",">"),array("<",">"),$response).
"</pre><br>"; }
return($response);
}
########################################################
# GET data from sendsms.html
########################################################
$phonenum = $_POST['recipient'];
$message = $_POST['message'];
$debug = true;
ozekiSend($phonenum,$message,$debug);
?>
I like to set this PHP code also inside clickatell.
Notice: $baseurl/http/sendmsg?PHP Code:$baseurl ="http://api.clickatell.com";
$url = "$baseurl/http/sendmsg?user=$username&password=$pword&api_id=$api_id&to=$to&text=$message";
How to set $baseurl/http/sendmsg? and all variables inside ARRAYS:
PHP Code:
//url-*** the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
My doubt: hi, i have 2 doubts. First one is how to send text message to mobile number using php and second one is how to update the result depends on our reply which is sent by mobile message.
please reply.
Hello,
*I found out how easy it was so*send text messages using*PHP, so that I can integrate*text*messaging into my apps!
I have been working on setting up a mobile website that you can send a text from using the code provide with a little modification. Everything works like I want except a message back to the sender that the message has been set. This is the message I get.
"Warning: Cannot modify header information - headers already sent by (output started at /home/content/92/9123492/html/dui/send_sms.php:9) in /home/content/92/9123492/html/dui/send_sms.php on line 25" ( Line 25: header ("Location: sms_success.php");)
Below is my php code:
<?php
$from = $_POST['from'];
$to = $_POST['to'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);
if ((empty($from)) || (empty($to)) || (empty($message))) {
header ("Location: sms_error.php");
}
else if ($carrier == "verizon") {
$formatted_number = $to."@vtext.com";
mail("$formatted_number", "From", "$from");
mail("$formatted_number", "I am being Arrested Call Attorney Jeremy Levy (419)243-8989", "$message");
header ("Location: sms_success.php");
}
else if ($carrier == "tmobile") {
$formatted_number = $to."@tomomail.net";
mail("$formatted_number", "I have been Arrested Call Attorney Jeremy Levy (419)243-8989", "$message");
header ("Location: sms_success.php");
}
else if ($carrier == "sprint") {
$formatted_number = $to."@messaging.sprintpcs.com";
mail("$formatted_number", "I have been Arrested Call Attorney Jeremy Levy (419)243-8989", "$message");
header ("Location: sms_success.php");
}
else if ($carrier == "att") {
$formatted_number = $to."@txt.att.net";
mail("$formatted_number", "I have been Arrested Call Attorney Jeremy Levy (419)243-8989", "$message");
header ("Location: sms_success.php");
}
else if ($carrier == "virgin") {
$formatted_number = $to."@vmobl.com";
mail("$formatted_number", "I have been Arrested Call Attorney Jeremy Levy (419)243-8989", "$message");
header ("Location: sms_success.php");
}
?>
I have tried using
header('Location: http://www.duitoledoattorney.com/');
no luck
Thanks
Larry
I'm a total newb so thanks in advance for your patience.
I've translated some of my web pages into Chinese and understand that Chinese are generally more active and proficient online with their mobile phones rather than with PCs. I also understand that Chinese mobile phones have 11 digit numbers without area codes.
I'd also like the contents of the message to be preformatted ie. "A web page for you: [& a clickable URL?]"
It looks like the country has 32 mobile operators.
Is this possible? Should I even bother to undertake this daunting task?