Page 1 of 2
Send reg code via SMS
Posted: Thu Mar 25, 2004 9:59 pm
by seeker2921
I've searched the net on how to send a text message to a cell via SMS and I found the simplewire network but I can't use there network due to the fact that I need to use each carriers network so for example the user registers on my site and enters the 10 digit cell number and then there carrier and my script sends them a temp password to prove that its there phone they are registering with.. how would I do this?
Posted: Thu Mar 25, 2004 10:04 pm
by Goowe
First off, I know that on my cell phone you can't send from provider to another provider without knowing the "e-mail" for that cell phone. I think every cell phone that receives SMS messages has an e-mail from the service provider?
So if you know the e-mail suffix for each carrier, and if you know the syntax for their e-mail addresses (
xxxyyyzzzz@sms.cellprovider.com) you could set it up so it changes their cell phone number into the correct format and adds the e-mail suffix for each provider... the problem is you have to know the correct syntax and suffix for -every- provider that the user might put in
Hope this helps somewhat, perhaps another user has a brilliant idea!

Posted: Thu Mar 25, 2004 10:12 pm
by Illusionist
did you look at
Hotscript.com Found some SMS things there that may be useful!
Posted: Thu Mar 25, 2004 10:14 pm
by Goowe
Aww, once again I was saved by Illusionist

Nice find Ill!
Posted: Thu Mar 25, 2004 10:15 pm
by Illusionist
lol, i actually like you idea though. I might add something similar like that to my site, only limiting people to send messages to certain providers.
Posted: Thu Mar 25, 2004 11:18 pm
by PrObLeM
I did this...if you want to use it go ahead works pretty good
Code: Select all
<?php
//Created by Mike L.
//Filename: sms.php
//can only be include and not ran on own
if(eregi("sms.php",$PHP_SELF)) exit();
?>
<SCRIPT LANGUAGE="JavaScript">
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
</script>
<?
if ($_POST["action"] == "send") {
// Sort through services
switch($_POST["service"])
{
case 'att':
$service = "mobile.att.net";
break;
case 'cingular':
$service = "mycingular.com";
break;
case 'nextel':
$service = "messaging.nextel.com";
break;
case 'qwest':
$service = "qwestp.com";
break;
case 'sprintpcs':
$service = "messaging.sprintpcs.com";
break;
case 't-mobile':
$service = "tmomail.net";
break;
case 'verizon':
$service = "vtext.com";
break;
case 'voicestream':
$service = "voicestream.net";
break;
}
// Trim up a few variables
$number = str_replace("(", "", $_POST["number"]);
$number = str_replace(")", "", $number);
$number = str_replace("-", "", $number);
$number = str_replace(" ", "", $number);
$number = eregi_replace("^[a-zA-Z]$", "", $number);
$smsto = $number . "@" . $service;
if (strlen($message) == 0)
{
echo "No Message was entered please try again.<p>\n\n";
}
else
{
mail($smsto, $subject, $message, "From: $from") or die("Unable to send your message. Please try again later.");
echo "Your message has been sent.<p>\n\n";
}
}
?>
<form method="post" align="center" action="<?php echo $PHP_SELF; ?>">
<input type=hidden name=action value=send>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td><b>Number:</b></td><td valign="top" align=left><input type="text" name=number size=43></td></tr>
<tr><td><b>Service:</b></td><td valign="top" align=left><select name=service ><option value="att">AT&T Wireless<option value="cingular">Cingular<option value="nextel">Nextel<option value="qwest">Qwest Wireless<option value="sprintpcs">Sprint PCS<option value="t-mobile">T-Mobile<option value="verizon">Verizon<option value="voicestream">VoiceStream</select></td></tr>
<tr><td><b>From:(name@website.com)</b></td><td valign="top" align=left><input type="text" name=from size=43></td></tr>
<tr><td><b>Message:</b></td><td valign="top"><textarea name=message rows=10 cols=40 onKeyDown="textCounter(this.form.message,this.form.remLen,130);" onKeyUp="textCounter(this.form.message,this.form.remLen,130);"></textarea></td></tr>
<tr><td><b>Characters left:</b></td><td valign="top" align=left><input readonly type=text name=remLen size=3 maxlength=3 value="130"></td></tr>
<tr><td valign="top" align=left></td><td valign="top" align=left><INPUT TYPE="submit" width=84 height=15 border=0 value="Send Message" ></td></tr>
</table>
</form>
Posted: Fri Mar 26, 2004 12:56 am
by seeker2921
Thanks for the code, It helped. But that code use's the mail function and I am woundering if that works with all carriers and is it possible to send ringtons and such using this?
Posted: Fri Mar 26, 2004 12:58 am
by PrObLeM
it doesnt work with all carriers all but cricket in the US basically its
$number @ carrierswebsiteforsms.com
ist just a small email
im 99.9% sure you cant send it using the mail function you have to use a gateway for that ...and it costs about 5cents a sms message (thats billed to you not the phone users)
Posted: Fri Mar 26, 2004 2:22 am
by seeker2921
I was planning on offering this service for free, If its going to cost me money to send them somehting for free I might want to re think my idea.. lol
I tried something just for kicks.. I have an e-mail for my fone..
xxxxxxxxxx@email.uscc.net and I tried to send a midi file using outlook to my cell phone and my phone got it no problem.. So do you think that I could just do the same with mail function?
Posted: Fri Mar 26, 2004 8:43 am
by PrObLeM
then yea you have to attach the file...ive never tried to send files to my cell phone so im not sure
Posted: Fri Mar 26, 2004 4:51 pm
by seeker2921
It didn't work, I also can't get it to work using outlook again.. It's really starting to <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> me off..
Posted: Fri Mar 26, 2004 6:07 pm
by PrObLeM
yea i tried sending to my phone and it didnt work
Posted: Fri Mar 26, 2004 11:20 pm
by Goowe
It wouldn't cost you money to send to the phone, and it shouldn't cost the person money to receive messages (only to send)... that's how it is for me.
Posted: Fri Mar 26, 2004 11:39 pm
by seeker2921
Yea, But does that include if you use a gateway and not a phone?
Posted: Fri Mar 26, 2004 11:46 pm
by Goowe
A gateway? As in sending e-mails that forward to the phone? (sorry, I'm not always on the smart side)
It's free for anyone to send me text messages (to my phone) via the internet
http://sms.alaskadigitel.com/ and if you login to hotmail you can send them straight to my phone too
