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...
I am on a godaddy hosting plan, not sure how to fix this.
Thanks,
Stephen
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 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
//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);
######################################################## # Login information for the SMS Gateway ########################################################
$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 ########################################################
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.
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")
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");
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?
Bookmarks